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

To reply to this bug, email your comments to 31609 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31609; Package emacs. (Sun, 27 May 2018 16:45:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ville Skyttä <ville.skytta <at> iki.fi>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 27 May 2018 16:45:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ville Skyttä <ville.skytta <at> iki.fi>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.3; sh-mode is confused about bash extglobs in case patterns
Date: Sun, 27 May 2018 18:44:08 +0200
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.

In GNU Emacs 25.3.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.25)
 of 2018-04-19 built on lgw01-amd64-032
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
System Description: Ubuntu 17.10

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=25 --with-modules --with-x=yes --with-x-toolkit=gtk3
 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs25-VAyiBS/emacs25-25.3~1.gite0284ab=.
-fstack-protector-strong
 -Wformat -Werror=format-security -no-pie' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro
 -no-pie''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LC_MONETARY: fi_FI.UTF-8
  value of $LC_NUMERIC: fi_FI.UTF-8
  value of $LC_TIME: fi_FI.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  global-company-mode: t
  company-mode: t
  projectile-global-mode: t
  projectile-mode: t
  which-function-mode: t
  show-paren-mode: t
  global-hl-line-mode: t
  editorconfig-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading editorconfig...done
Loading hl-line...done
Loading paren...done
Loading which-func...done
Turn on helm-projectile key bindings
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
/home/scop/.emacs.d/elpa/editorconfig-0.7.11/editorconfig-autoloads
hides /usr/share/emacs/site-lisp/elpa-src/editorconfig-0.4/editorconfig-autoloads
/home/scop/.emacs.d/elpa/editorconfig-0.7.11/editorconfig-pkg hides
/usr/share/emacs/site-lisp/elpa-src/editorconfig-0.4/editorconfig-pkg
/home/scop/.emacs.d/elpa/editorconfig-0.7.11/editorconfig hides
/usr/share/emacs/site-lisp/elpa-src/editorconfig-0.4/editorconfig
/usr/share/emacs/site-lisp/dictionaries-common/ispell hides
/usr/share/emacs/25.3/lisp/textmodes/ispell
/usr/share/emacs/site-lisp/dictionaries-common/flyspell hides
/usr/share/emacs/25.3/lisp/textmodes/flyspell
/home/scop/.emacs.d/elpa/let-alist-1.0.5/let-alist hides
/usr/share/emacs/25.3/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug message dired rfc822 mml mml-sec epg
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils
company-oddmuse company-keywords company-etags etags xref project
company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-css company-nxml company-bbdb
company-anaconda anaconda-mode pythonic f s python tramp-sh url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse url-vars mailcap tramp tramp-compat
auth-source gnus-util mm-util help-fns mail-prsvr password-cache
tramp-loaddefs trampver ucs-normalize shell pcomplete company
helm-projectile helm-files helm-tags helm-buffers helm-locate helm-types
projectile grep compile comint ansi-color ring ibuf-ext ibuffer
thingatpt helm-swoop helm-grep helm-regexp format-spec helm-utils
helm-help helm helm-source cl-seq eieio-compat eieio eieio-core cl-macs
helm-multi-match helm-lib advice async iso-transl edmacro kmacro
jka-compr which-func imenu paren hl-line editorconfig cus-start cus-load
flycheck json map find-func subr-x dash use-package diminish bind-key
easy-mmode finder-inf rx info package epg-config seq byte-opt gv
bytecomp byte-compile cl-extra help-mode easymenu cconv cl-loaddefs
pcase cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 324999 11377)
 (symbols 48 32532 0)
 (miscs 40 452 122)
 (strings 32 60098 10582)
 (string-bytes 1 1978257)
 (vectors 16 52692)
 (vector-slots 8 860266 5620)
 (floats 8 424 17)
 (intervals 56 309 71)
 (buffers 976 17))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31609; Package emacs. (Sun, 27 May 2018 21:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 31609 <at> debbugs.gnu.org (full text, mbox):

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: Re: 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.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31609; Package emacs. (Sun, 27 May 2018 23:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 31609 <at> debbugs.gnu.org (full text, mbox):

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: Re: bug#31609: 25.3; sh-mode is confused about bash extglobs in
 case patterns
Date: Mon, 28 May 2018 11:37:40 +1200
I suspect this is a duplicate of #21321 ?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31609; Package emacs. (Mon, 28 May 2018 00:20:01 GMT) Full text and rfc822 format available.

Message #14 received at 31609 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 31609 <at> debbugs.gnu.org, Ville Skyttä <ville.skytta <at> iki.fi>,
 bug-gnu-emacs <bug-gnu-emacs-bounces+psainty=orcon.net.nz <at> gnu.org>
Subject: Re: bug#31609: 25.3;
 sh-mode is confused about bash extglobs in case patterns
Date: Sun, 27 May 2018 20:18:54 -0400
forcemerge 21321 31609
quit

Phil Sainty <psainty <at> orcon.net.nz> writes:

> I suspect this is a duplicate of #21321 ?

Yup, this one has a much clearer title though.





Forcibly Merged 21321 31609. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 28 May 2018 00:20:04 GMT) Full text and rfc822 format available.

Merged 21321 25353 31609. Request was from Glenn Morris <rgm <at> fencepost.gnu.org> to control <at> debbugs.gnu.org. (Tue, 11 Jan 2022 16:50:01 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 116 days ago.

Previous Next


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