bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#1320: marked as done (sh-mode indentation of "case $foo in (bar)")


From: Emacs bug Tracking System
Subject: bug#1320: marked as done (sh-mode indentation of "case $foo in (bar)")
Date: Sat, 24 Oct 2009 21:25:06 +0000

Your message dated Sat, 24 Oct 2009 17:16:39 -0400
with message-id <871vks332g.fsf@stupidchicken.com>
and subject line Re: sh-mode indentation of "case $foo in (bar)"
has caused the Emacs bug report #1320,
regarding sh-mode indentation of "case $foo in (bar)"
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
1320: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1320
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems
--- Begin Message --- Subject: sh-mode indentation of "case $foo in (bar)" Date: Fri, 31 Oct 2008 03:29:13 -0700 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
[ resent from
http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00906.html ]

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.



--- End Message ---
--- Begin Message --- Subject: Re: sh-mode indentation of "case $foo in (bar)" Date: Sat, 24 Oct 2009 17:16:39 -0400
> #
> 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.

Sorry for the late response.  I've checked in a fix for this problem
into Emacs CVS.

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]