GNU bug report logs - #7947
Does sh-script.el recognize new case grammar ;& and ;;& ?

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Mon, 31 Jan 2011 12:56:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 7947 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: jidanni <at> jidanni.org
Cc: 7947 <at> debbugs.gnu.org
Subject: Re: bug#7947: Does sh-script.el recognize new case grammar ; & and ; ;
	& ?
Date: Tue, 01 Feb 2011 12:56:23 -0500
SM> a reference describing what it means

> $ man bash|grep ';&'
>               matches are attempted after the first pattern match.  Using ;&
> in place of ;; causes execution to continue
>               with the list associated with the next set of patterns.
> Using ;;& in place of ;; causes the shell to test
> Also on Debian in /usr/share/doc/abs-guide/examples/case4.sh

> All I know is indenting seems funny around them when using emacs'
> sh-script.el .

Does the patch below fix things for you?


        Stefan


=== modified file 'lisp/progmodes/sh-script.el'
--- lisp/progmodes/sh-script.el	2011-01-26 08:36:39 +0000
+++ lisp/progmodes/sh-script.el	2011-02-01 17:55:26 +0000
@@ -1104,7 +1104,7 @@
                  ;; a normal command rather than the real `in' keyword.
                  ;; I.e. we should look back to try and find the
                  ;; corresponding `case'.
-                 (looking-at ";;\\|in"))
+                 (looking-at ";[;&]\\|in"))
       sh-st-punc)))
 
 (defun sh-font-lock-backslash-quote ()
@@ -1659,6 +1659,8 @@
      ("esac" sh-handle-this-esac sh-handle-prev-esac)
      (case-label nil sh-handle-after-case-label) ;; ???
      (";;" nil sh-handle-prev-case-alt-end) ;; ???
+     (";;&" nil sh-handle-prev-case-alt-end) ;; ???
+     (";&" nil sh-handle-prev-case-alt-end) ;; ???
      ("done" sh-handle-this-done sh-handle-prev-done)
      ("do" sh-handle-this-do sh-handle-prev-do))
 
@@ -2496,7 +2498,7 @@
                          (sh-prev-line nil)
                        (line-beginning-position))))
       (skip-chars-backward " \t;" min-point)
-      (if (looking-at "\\s-*;;")
+      (if (looking-at "\\s-*;[;&]")
           ;; (message "Found ;; !")
           ";;"
         (skip-chars-backward "^)}];\"'`({[" min-point)





This bug report was last modified 14 years and 108 days ago.

Previous Next


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