bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12963: Fwd: Small modification to sh-script, to cover unsupported ca


From: Daniel Pfeiffer
Subject: bug#12963: Fwd: Small modification to sh-script, to cover unsupported case label
Date: Thu, 22 Nov 2012 23:31:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0




-------- 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 <ivan@ivankelly.net>
To: Daniel Pfeiffer <occitan@esperanto.org>


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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]