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

Previous Next

Package: emacs;

Reported by: occitan <at> esperanto.org

Date: Thu, 22 Nov 2012 22:34:02 UTC

Severity: normal

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Daniel Pfeiffer <occitan <at> t-online.de>
To: 12963 <at> debbugs.gnu.org
Cc: Ivan Kelly <ivan <at> ivankelly.net>
Subject: bug#12963: Fwd: Small modification to sh-script, to cover unsupported case label
Date: Thu, 22 Nov 2012 23:31:37 +0100
[Message part 1 (text/plain, inline)]


-------- 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 <at> ivankelly.net>
To: 	Daniel Pfeiffer <occitan <at> 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



[Message part 2 (text/html, inline)]

This bug report was last modified 12 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.