From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Chen Newsgroups: gmane.emacs.devel Subject: sh-mode indentation of "case $foo in (bar)" Date: Fri, 31 Oct 2008 03:29:13 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1225448981 24361 80.91.229.12 (31 Oct 2008 10:29:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2008 10:29:41 +0000 (UTC) To: Emacs Developement List Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 31 11:30:43 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KvrH4-0000Y1-2W for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2008 11:30:38 +0100 Original-Received: from localhost ([127.0.0.1]:46243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvrFw-0000SB-Ps for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2008 06:29:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvrFq-0000Re-Jw for emacs-devel@gnu.org; Fri, 31 Oct 2008 06:29:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvrFo-0000QE-8A for emacs-devel@gnu.org; Fri, 31 Oct 2008 06:29:21 -0400 Original-Received: from [199.232.76.173] (port=35277 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvrFo-0000Q4-3g for emacs-devel@gnu.org; Fri, 31 Oct 2008 06:29:20 -0400 Original-Received: from roar.cs.berkeley.edu ([128.32.36.242]:49603 helo=roar.quarl.org) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KvrFn-0007Uh-Mi for emacs-devel@gnu.org; Fri, 31 Oct 2008 06:29:19 -0400 Original-Received: by roar.quarl.org (Postfix, from userid 18378) id E8CAA343E4; Fri, 31 Oct 2008 03:29:13 -0700 (PDT) X-Quack-Archive: 1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6? (barebone, rare!) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105183 Archived-At: emacs -Q /tmp/case.sh # case x in y) y2 ;; (z) z2 ;; esac M-: (indent-region (point-min) (point-max)) Result: # case x in y) y2 ;; (z) z2 ;; esac Expected: # case x in y) y2 ;; (z) z2 ;; esac Running (sh-get-indent-info) on the y2 line includes sh-indent-for-case-alt in the result (as expected); running (sh-get-indent-info) on the z2 line doesn't yield sh-indent-for-case-alt. The "(altpattern)" syntax with leading opening parenthesis is supported by various shells (bash, ksh, zsh). Also, a second indentation bug: if the first line in the buffer is the case statement, sh-mode gets even more confused and double-indents the y2 line. This is rare though since usually the first line is "#!"; I only noticed it while constructing this bug report. Tested on emacs 22.2 and emacs 2008-10-31.