all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* sh-mode indentation of "case $foo in (bar)"
@ 2008-10-31 10:29 Karl Chen
  0 siblings, 0 replies; only message in thread
From: Karl Chen @ 2008-10-31 10:29 UTC (permalink / raw)
  To: Emacs Developement List


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.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-31 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-31 10:29 sh-mode indentation of "case $foo in (bar)" Karl Chen

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.