]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/sh-script.el
Merge from emacs-24
[gnu-emacs] / lisp / progmodes / sh-script.el
index 5631358b472bcfb4408529892ea45358922edff1..524749d6266878bc3dab27dd0d96b4423b53a606 100644 (file)
@@ -2014,12 +2014,12 @@ May return nil if the line should not be treated as continued."
                    (and (numberp indent) (numberp initial)
                         (<= indent initial)))))
      `(column . ,(+ initial sh-indentation)))
-    (`(:before . ,(or `"(" `"{" `"["))
+    (`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case"))
      (if (not (smie-rule-prev-p "&&" "||" "|"))
          (when (smie-rule-hanging-p)
            (smie-rule-parent))
        (unless (smie-rule-bolp)
-        (smie-backward-sexp 'halfexp)
+        (while (equal "|" (nth 2 (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.