]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 19 Jun 2014 22:52:12 +0000 (18:52 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 19 Jun 2014 22:52:12 +0000 (18:52 -0400)
for |.

Fixes: debbugs:17621
lisp/ChangeLog
lisp/progmodes/sh-script.el
test/indent/shell.sh

index d7ca5f0dd881a19d66b4154c352852699f9f5c8f..90798ab722eb43499acd497d4daee70804bd77d8 100644 (file)
@@ -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).
index 03c845851e26aa24f5a3d3b65190640a7e69b436..c407ba24e201cbdc8d72276b69dd3b98f9c0bff1 100644 (file)
@@ -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))
index fdf736e06bec1892622a2bb849192be3b09c1191..74985a401d447f144a8ff9ba92eea75517221dae 100755 (executable)
@@ -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