aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-07-08 14:38:07 -0400
committerStefan Monnier2014-07-08 14:38:07 -0400
commitd8899d09b992d733dc1cc6ec93b11cb75ce84f5d (patch)
tree86545998caf5d00d888e7ed23f9ef9a510a7a18c
parentc838708452e293d8d55f1476f599eff28b94f255 (diff)
downloademacs-d8899d09b992d733dc1cc6ec93b11cb75ce84f5d.tar.gz
emacs-d8899d09b992d733dc1cc6ec93b11cb75ce84f5d.zip
* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in
the middle of a line. Fixes: debbugs:17896
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/sh-script.el7
-rwxr-xr-xtest/indent/shell.sh6
3 files changed, 15 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 13cb52acc1c..0333e366beb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-07-08 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in
4 the middle of a line (bug#17896).
5
12014-07-08 Juri Linkov <juri@jurta.org> 62014-07-08 Juri Linkov <juri@jurta.org>
2 7
3 * startup.el (command-line): Append displaying the warning about 8 * startup.el (command-line): Append displaying the warning about
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 1601b6c81ae..724d22ab69b 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1989,9 +1989,10 @@ May return nil if the line should not be treated as continued."
1989 (<= indent initial))))) 1989 (<= indent initial)))))
1990 `(column . ,(+ initial sh-indentation))) 1990 `(column . ,(+ initial sh-indentation)))
1991 (`(:before . ,(or `"(" `"{" `"[")) 1991 (`(:before . ,(or `"(" `"{" `"["))
1992 (when (smie-rule-hanging-p) 1992 (if (not (smie-rule-prev-p "&&" "||" "|"))
1993 (if (not (smie-rule-prev-p "&&" "||" "|")) 1993 (when (smie-rule-hanging-p)
1994 (smie-rule-parent) 1994 (smie-rule-parent))
1995 (unless (smie-rule-bolp)
1995 (smie-backward-sexp 'halfexp) 1996 (smie-backward-sexp 'halfexp)
1996 `(column . ,(smie-indent-virtual))))) 1997 `(column . ,(smie-indent-virtual)))))
1997 ;; FIXME: Maybe this handling of ;; should be made into 1998 ;; FIXME: Maybe this handling of ;; should be made into
diff --git a/test/indent/shell.sh b/test/indent/shell.sh
index 4a30739e2d9..e3619057d6e 100755
--- a/test/indent/shell.sh
+++ b/test/indent/shell.sh
@@ -41,6 +41,12 @@ for foo in bar; do # bug#17721
41 } 41 }
42done 42done
43 43
44for foo in bar; do # bug#17896
45 [ -e $foo ] && [ -e $bar ] && {
46 echo just fine thanks
47 }
48done
49
44filter_3 () # bug#17842 50filter_3 () # bug#17842
45{ 51{
46 tr -d '"`' | tr ' ' ' ' | \ 52 tr -d '"`' | tr ' ' ' ' | \