]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 19 Apr 2014 17:14:27 +0000 (13:14 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 19 Apr 2014 17:14:27 +0000 (13:14 -0400)
assignments such as "case=hello".

Fixes: debbugs:17297
lisp/ChangeLog
lisp/progmodes/sh-script.el

index 729c0b2a40c1ab4e91c942fac3455effc6b7e966..d762078dfd0272767fd21ab92e00739df5ab74cc 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable
+       assignments such as "case=hello" (bug#17297).
+
 2014-04-18  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-run-real-handler, tramp-file-name-handler):
index 8ab6a0466d4b43989b3eae1c07d2ad897964ea72..06d7a8fdffea62f0edf64789f15dace074cb7856 100644 (file)
@@ -1832,9 +1832,10 @@ Does not preserve point."
 
 (defun sh-smie--sh-keyword-p (tok)
   "Non-nil if TOK (at which we're looking) really is a keyword."
-  (if (equal tok "in")
-      (sh-smie--sh-keyword-in-p)
-    (sh-smie--keyword-p)))
+  (cond
+   ((looking-at "[[:alnum:]_]+=") nil)
+   ((equal tok "in") (sh-smie--sh-keyword-in-p))
+   (t (sh-smie--keyword-p))))
 
 (defun sh-smie-sh-forward-token ()
   (if (and (looking-at "[ \t]*\\(?:#\\|\\(\\s|\\)\\|$\\)")