emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117365: * lisp/progmodes/sh-script.el (sh-smie-s


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-24 r117365: * lisp/progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in
Date: Tue, 08 Jul 2014 18:38:16 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117365
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17896
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Tue 2014-07-08 14:38:07 -0400
message:
  * lisp/progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in
  the middle of a line.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/sh-script.el    shscript.el-20091113204419-o5vbwnq5f7feedwu-727
  test/indent/shell.sh           shell.sh-20110209185043-iuyrh0is1gz0s4w6-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-07-08 09:17:09 +0000
+++ b/lisp/ChangeLog    2014-07-08 18:38:07 +0000
@@ -1,3 +1,8 @@
+2014-07-08  Stefan Monnier  <address@hidden>
+
+       * progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in
+       the middle of a line (bug#17896).
+
 2014-07-08  Juri Linkov  <address@hidden>
 
        * startup.el (command-line): Append displaying the warning about

=== modified file 'lisp/progmodes/sh-script.el'
--- a/lisp/progmodes/sh-script.el       2014-06-24 20:16:10 +0000
+++ b/lisp/progmodes/sh-script.el       2014-07-08 18:38:07 +0000
@@ -1989,9 +1989,10 @@
                         (<= indent initial)))))
      `(column . ,(+ initial sh-indentation)))
     (`(:before . ,(or `"(" `"{" `"["))
-     (when (smie-rule-hanging-p)
-       (if (not (smie-rule-prev-p "&&" "||" "|"))
-          (smie-rule-parent)
+     (if (not (smie-rule-prev-p "&&" "||" "|"))
+         (when (smie-rule-hanging-p)
+           (smie-rule-parent))
+       (unless (smie-rule-bolp)
         (smie-backward-sexp 'halfexp)
         `(column . ,(smie-indent-virtual)))))
     ;; FIXME: Maybe this handling of ;; should be made into

=== modified file 'test/indent/shell.sh'
--- a/test/indent/shell.sh      2014-06-24 20:16:10 +0000
+++ b/test/indent/shell.sh      2014-07-08 18:38:07 +0000
@@ -41,6 +41,12 @@
     }
 done
 
+for foo in bar; do              # bug#17896
+    [ -e $foo ] && [ -e $bar ] && {
+        echo just fine thanks
+    }
+done
+
 filter_3 ()                     # bug#17842
 {
     tr -d '"`' | tr '  ' ' ' | \


reply via email to

[Prev in Thread] Current Thread [Next in Thread]