diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-06-19 18:52:12 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-06-19 18:52:12 -0400 |
commit | e9638b49e53127fe410fbc3689c1d781c61e09b7 (patch) | |
tree | 09c37f1e6251a2eb983ecf0d9f73563496584f5a | |
parent | 1503d26aa07983b9c0c06b8d10a570a63eee7515 (diff) | |
download | emacs-e9638b49e53127fe410fbc3689c1d781c61e09b7.tar.gz |
* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as
for |.
Fixes: debbugs:17621
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/progmodes/sh-script.el | 2 | ||||
-rwxr-xr-x | test/indent/shell.sh | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d7ca5f0dd88..90798ab722e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-06-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as + for | (bug#17621). + 2014-06-18 Stefan Monnier <monnier@iro.umontreal.ca> * xt-mouse.el (xterm-mouse-translate-1): Fix last change (bug#17776). diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 03c845851e2..c407ba24e20 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1970,7 +1970,7 @@ May return nil if the line should not be treated as continued." (smie-rule-bolp)))) (current-column) (smie-indent-calculate))))) - (`(:after . "|") (if (smie-rule-parent-p "|") nil 4)) + (`(:after . ,(or `"|" `"&&" `"||")) (if (smie-rule-parent-p token) nil 4)) ;; Attempt at backward compatibility with the old config variables. (`(:before . "fi") (sh-var-value 'sh-indent-for-fi)) (`(:before . "done") (sh-var-value 'sh-indent-for-done)) diff --git a/test/indent/shell.sh b/test/indent/shell.sh index fdf736e06be..74985a401d4 100755 --- a/test/indent/shell.sh +++ b/test/indent/shell.sh @@ -23,6 +23,12 @@ case $X in ;; esac +{ # bug#17621 + foo1 && + foo2 && + bar +} + echo -n $(( 5 << 2 )) # This should not be treated as a heredoc (bug#12770). 2 |