From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#7947: Does sh-script.el recognize new case grammar ; & and ; ; & ? Date: Tue, 01 Feb 2011 12:56:23 -0500 Message-ID: References: <87sjw8txsn.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1296588849 5240 80.91.229.12 (1 Feb 2011 19:34:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Feb 2011 19:34:09 +0000 (UTC) Cc: 7947@debbugs.gnu.org To: jidanni@jidanni.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 01 20:34:04 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PkLzG-0002MY-Ev for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Feb 2011 20:34:02 +0100 Original-Received: from localhost ([127.0.0.1]:35959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkKg6-0000Yx-Dd for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Feb 2011 13:10:10 -0500 Original-Received: from [140.186.70.92] (port=40691 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkKbx-0005cm-K6 for bug-gnu-emacs@gnu.org; Tue, 01 Feb 2011 13:06:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkKbk-0001wK-Dl for bug-gnu-emacs@gnu.org; Tue, 01 Feb 2011 13:05:41 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkKbk-0001wD-Bx for bug-gnu-emacs@gnu.org; Tue, 01 Feb 2011 13:05:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PkKLd-0003Ms-Le; Tue, 01 Feb 2011 12:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Feb 2011 17:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7947 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7947-submit@debbugs.gnu.org id=B7947.129658248312880 (code B ref 7947); Tue, 01 Feb 2011 17:49:01 +0000 Original-Received: (at 7947) by debbugs.gnu.org; 1 Feb 2011 17:48:03 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkKKg-0003LY-IV for submit@debbugs.gnu.org; Tue, 01 Feb 2011 12:48:02 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PkKKe-0003LD-Ff for 7947@debbugs.gnu.org; Tue, 01 Feb 2011 12:48:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhEHADvYR01Ld/8K/2dsb2JhbACWZI4idLxyhVMEhROPZA X-IronPort-AV: E=Sophos;i="4.60,411,1291611600"; d="scan'208";a="90146916" Original-Received: from 75-119-255-10.dsl.teksavvy.com (HELO ceviche.home) ([75.119.255.10]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 01 Feb 2011 12:56:23 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 24F31660DC; Tue, 1 Feb 2011 12:56:23 -0500 (EST) In-Reply-To: <87sjw8txsn.fsf@jidanni.org> (jidanni@jidanni.org's message of "Tue, 01 Feb 2011 08:15:36 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 01 Feb 2011 12:49:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43815 Archived-At: 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)