all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: jidanni@jidanni.org
Cc: 7947@debbugs.gnu.org
Subject: bug#7947: Does sh-script.el recognize new case grammar ; & and ; ; & ?
Date: Tue, 01 Feb 2011 12:56:23 -0500	[thread overview]
Message-ID: <jwvei7r3aht.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87sjw8txsn.fsf@jidanni.org> (jidanni@jidanni.org's message of "Tue, 01 Feb 2011 08:15:36 +0800")

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)






  reply	other threads:[~2011-02-01 17:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 12:50 bug#7947: Does sh-script.el recognize new case grammar ; & and ; ; & ? jidanni
2011-01-31 15:35 ` Stefan Monnier
2011-01-31 22:50   ` Glenn Morris
2011-02-01  0:15 ` jidanni
2011-02-01 17:56   ` Stefan Monnier [this message]
2011-02-01 23:23 ` jidanni
2011-02-05 15:53 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvei7r3aht.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=7947@debbugs.gnu.org \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.