unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: "Ville Skyttä" <ville.skytta@iki.fi>
Cc: 31609@debbugs.gnu.org,
	bug-gnu-emacs
	<bug-gnu-emacs-bounces+psainty=orcon.net.nz@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	[thread overview]
Message-ID: <258635115c95ebb3eb97444c62c63307@webmail.orcon.net.nz> (raw)
In-Reply-To: <CABr9L5CBkvqVyz3QJU1xqf_d3bsVcvq48kNPVNj=vUUv=mxa7Q@mail.gmail.com>

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.






  reply	other threads:[~2018-05-27 21:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-27 16:44 bug#31609: 25.3; sh-mode is confused about bash extglobs in case patterns Ville Skyttä
2018-05-27 21:32 ` Phil Sainty [this message]
2018-05-27 23:37   ` Phil Sainty
2018-05-28  0:18     ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=258635115c95ebb3eb97444c62c63307@webmail.orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=31609@debbugs.gnu.org \
    --cc=bug-gnu-emacs-bounces+psainty=orcon.net.nz@gnu.org \
    --cc=ville.skytta@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).