From: Stefan Monnier Date: Sat, 19 Apr 2014 17:14:27 +0000 (-0400) Subject: * lisp/progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable X-Git-Tag: emacs-24.3.91~124 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe36068f12b959de7c368b7e50cded27e76c0245;p=emacs.git * lisp/progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable assignments such as "case=hello". Fixes: debbugs:17297 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 729c0b2a40c..d762078dfd0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-04-19 Stefan Monnier + + * progmodes/sh-script.el (sh-smie--sh-keyword-p): Handle variable + assignments such as "case=hello" (bug#17297). + 2014-04-18 Michael Albinus * net/tramp.el (tramp-run-real-handler, tramp-file-name-handler): diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 8ab6a0466d4..06d7a8fdffe 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -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|\\)\\|$\\)")