summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-06-20 10:23:30 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-06-20 10:23:30 -0400
commit9e248ebdc71b051911ba1a68187d300bfff39fb3 (patch)
tree32356e67fc5269dfce022f36db137f353611b819 /lisp
parent58b9840b352eeb11ee1d09f0f3224c4b9ce22fad (diff)
downloademacs-9e248ebdc71b051911ba1a68187d300bfff39fb3.tar.gz
* lisp/progmodes/sh-script.el (sh-smie-sh-rules): For { after &&, don't
align with the surrounding parent. Fixes: debbugs:17721
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/sh-script.el6
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b7cd062d15c..81a8945be11 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-20 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * progmodes/sh-script.el (sh-smie-sh-rules): For { after &&, don't
+ align with the surrounding parent (bug#17721).
+
2014-06-20 Eli Zaretskii <eliz@gnu.org>
* textmodes/texinfo.el (texinfo-mode): Set skeleton-end-newline
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index f248494eed1..4db462594dc 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1952,7 +1952,11 @@ May return nil if the line should not be treated as continued."
(<= indent initial))
`(column . ,(+ initial sh-indentation)))))
(`(:before . ,(or `"(" `"{" `"["))
- (if (smie-rule-hanging-p) (smie-rule-parent)))
+ (when (smie-rule-hanging-p)
+ (if (not (smie-rule-prev-p "&&" "||" "|"))
+ (smie-rule-parent)
+ (smie-backward-sexp 'halfexp)
+ `(column . ,(smie-indent-virtual)))))
;; FIXME: Maybe this handling of ;; should be made into
;; a smie-rule-terminator function that takes the substitute ";" as arg.
(`(:before . ,(or `";;" `";&" `";;&"))