Subject: bug#12963: Fwd: Small modification to sh-script, to cover unsupported case label

From: Daniel Pfeiffer <[email-masked]>
Date: Thu, 22 Nov 2012 23:31:37 +0100

-------- Original Message --------
Subject: 	Small modification to sh-script, to cover unsupported case label
Date: 	Thu, 22 Nov 2012 15:53:25 +0000
From: 	Ivan Kelly <[email-masked]>
To: 	Daniel Pfeiffer <[email-masked]>

Hi,

I ran into an issue with the sh-mode today with case labels.
case $X in
     foo)
         do_something
         ;;
     arg=*)
         do_something_else_based_on_arg
         ;;
     *)
         default
         ;;
esac

Indention will mess up on the second label, due to the =
This can be fixed by adding a = to the skip-chars-backwards in
sh-font-lock-parens;

i.e.
(defun sh-font-lock-paren (start)
   (save-excursion
     (goto-char start)
     ;; Skip through all patterns
     (while
       (progn
         (forward-comment (- (point-max)))
         ;; Skip through one pattern
         (while
           (or (/= 0 (skip-syntax-backward "w_"))
           (/= 0 (skip-chars-backward "?[]*@/\\="))
             (and (sh-is-quoted-p (1- (point)))
...

Also, I'm finding indent-tabs-mode is being reset by sh-mode. Do you
know what could be causing this?

Regards
Ivan