all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#31609: 25.3; sh-mode is confused about bash extglobs in case patterns
@ 2018-05-27 16:44 Ville Skyttä
  2018-05-27 21:32 ` Phil Sainty
  0 siblings, 1 reply; 4+ messages in thread
From: Ville Skyttä @ 2018-05-27 16:44 UTC (permalink / raw)
  To: 31609

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))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#31609: 25.3; sh-mode is confused about bash extglobs in case patterns
  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
  2018-05-27 23:37   ` Phil Sainty
  0 siblings, 1 reply; 4+ messages in thread
From: Phil Sainty @ 2018-05-27 21:32 UTC (permalink / raw)
  To: Ville Skyttä; +Cc: 31609, bug-gnu-emacs

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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#31609: 25.3; sh-mode is confused about bash extglobs in case patterns
  2018-05-27 21:32 ` Phil Sainty
@ 2018-05-27 23:37   ` Phil Sainty
  2018-05-28  0:18     ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Phil Sainty @ 2018-05-27 23:37 UTC (permalink / raw)
  To: Ville Skyttä; +Cc: 31609, bug-gnu-emacs

I suspect this is a duplicate of #21321 ?






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#31609: 25.3; sh-mode is confused about bash extglobs in case patterns
  2018-05-27 23:37   ` Phil Sainty
@ 2018-05-28  0:18     ` Noam Postavsky
  0 siblings, 0 replies; 4+ messages in thread
From: Noam Postavsky @ 2018-05-28  0:18 UTC (permalink / raw)
  To: Phil Sainty; +Cc: 31609, Ville Skyttä, bug-gnu-emacs

forcemerge 21321 31609
quit

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

> I suspect this is a duplicate of #21321 ?

Yup, this one has a much clearer title though.






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-28  0:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-05-27 23:37   ` Phil Sainty
2018-05-28  0:18     ` Noam Postavsky

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.