GNU bug report logs - #31609
25.3; sh-mode is confused about bash extglobs in case patterns

Previous Next

Package: emacs;

Reported by: Ville Skyttä <ville.skytta <at> iki.fi>

Date: Sun, 27 May 2018 16:45:01 UTC

Severity: minor

Merged with 21321, 25353

Found in versions 24.5, 25.3

Full log


View this message in rfc822 format

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Ville Skyttä <ville.skytta <at> iki.fi>
Cc: 31609 <at> debbugs.gnu.org, bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>
Subject: bug#31609: 25.3; sh-mode is confused about bash extglobs in case patterns
Date: Mon, 28 May 2018 09:32:11 +1200
If a workaround helps you, these variants are correctly indented:

case $foo in
    (@(bar|quux)) : do things;;
    (@(bar|quux)) {
        : do things
    };;
esac


On 2018-05-28 04:44, Ville Skyttä wrote:
> When using bash's extended globbing constructs such as @(...), +(...),
> !(...), *(...) in case patterns, sh-mode gets confused and indentation
>          no longer works properly.
> 
> For example:
> 
> case $foo in
>     @(bar|quux))
>                 <-- TAB brings the cursor here
>         <-- ...whereas I would have expected it to be here
> [...]
> 
> The indentation continues to be off for the remainder of the file,
> i.e. after the ;; and terminating `esac'.
> 
> This is a largish annoyance for me when working with bash-completion,
> which currently uses these constructs quite a bit in case patterns, and
> more is on the way.





This bug report was last modified 3 years and 157 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.