diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/progmodes/sh-script.el | 6 |
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 `";;" `";&" `";;&")) |