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#753: [Fwd: sh-script.el: indentation of ( )] Date: Thu, 08 Jan 2009 22:58:08 -0500 Message-ID: References: <48AC8E68.8080503@t-online.de> <7f8wpl430a.fsf@fencepost.gnu.org> Reply-To: Stefan Monnier , 753@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1231475020 22529 80.91.229.12 (9 Jan 2009 04:23:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Jan 2009 04:23:40 +0000 (UTC) Cc: 753@emacsbugs.donarmstrong.com To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 09 05:24:50 2009 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.50) id 1LL8vR-0000ev-QJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Jan 2009 05:24:50 +0100 Original-Received: from localhost ([127.0.0.1]:34931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL8uB-0007Ro-Vu for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Jan 2009 23:23:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL8u8-0007Rc-TR for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 23:23:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL8u7-0007RP-03 for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 23:23:28 -0500 Original-Received: from [199.232.76.173] (port=33676 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL8u6-0007RM-Rq for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 23:23:26 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:33662) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LL8u6-0005fi-B1 for bug-gnu-emacs@gnu.org; Thu, 08 Jan 2009 23:23:26 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n094NOt0005950; Thu, 8 Jan 2009 20:23:24 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n09455lE001255; Thu, 8 Jan 2009 20:05:05 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 09 Jan 2009 04:05:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 753 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 753-submit@emacsbugs.donarmstrong.com id=B753.123147350531646 (code B ref 753); Fri, 09 Jan 2009 04:05:05 +0000 Original-Received: (at 753) by emacsbugs.donarmstrong.com; 9 Jan 2009 03:58:25 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n093wILM031640 for <753@emacsbugs.donarmstrong.com>; Thu, 8 Jan 2009 19:58:19 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmcFAI9aZklFxJt//2dsb2JhbACBbM1ehXSBaQ X-IronPort-AV: E=Sophos;i="4.37,237,1231131600"; d="scan'208";a="32058014" Original-Received: from 69-196-155-127.dsl.teksavvy.com (HELO pastel.home) ([69.196.155.127]) by ironport2-out.teksavvy.com with ESMTP; 08 Jan 2009 22:58:09 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id B62EC86E5; Thu, 8 Jan 2009 22:58:08 -0500 (EST) In-Reply-To: <7f8wpl430a.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu, 08 Jan 2009 21:39:01 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 08 Jan 2009 23:23:28 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:23936 Archived-At: >> Basically, what I saw is that it recognized "done|" as a keyword, >> which I fixed by adding ?| to the "not in keywords" chars. By the >> same reasonging "done)" is not a keyword, so I added ?\) (and ?\( as >> well for good measure). > Adding them causes the problem you are trying to avoid. I don't follow you. > Applying (skip-chars-forward "^ \t\n;&|") > to "done) " > results in "done)", which is not a recognized keyword. So does the original code (skip-chars-forward "^ \t\n;&"), but so doesn't my code (skip-chars-forward "^ \t\n;&|()"). In this sense my code did make things more correct. >> I guess that sh-get-kw should be fixed more robustly by recognizing >> ")" and "(" but not "(done", nor "(done|toto)" for that matter. Can >> you take care of that and make sure it fixes the problem at hand >> without breaking the problem that prompted my misguided fix? > It's tricky. Consider the following two examples: > for f in 1; do > case $f in > done) echo t ;; > esac > done > (for f in 1; do > echo $f > done) > In the second one, "done)" ends a for loop, in the first one it does not. It doesn't matter. "done)" is not an entity in `sh', so we should not treat it as one. After all if you replace "done)" with "done )" in the above 2 scripts, they still mean the same. > Both Emacs 22.3 and the current CVS get both examples wrong, in > different ways. Yes, but it's a due to different bug than the one at hand, IIUC. Stefan