Commit 43668fb1 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/progmodes/sh-script.el (sh-smie--sh-keyword-in-p): Don't inf-loop

at bobp.
(sh-smie--sh-keyword-in-p): Recognize keywords at bobp.

Fixes: debbugs:15826
parent daddb3fd
2013-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/sh-script.el (sh-smie--sh-keyword-in-p): Don't inf-loop
at bobp (bug#15826).
(sh-smie--sh-keyword-in-p): Recognize keywords at bobp.
2013-11-08 Darren Hoo <darren.hoo@gmail.com>
* man.el (Man-start-calling): New macro, extracted from
......
......@@ -1730,7 +1730,7 @@ A keyword position is one where if we're looking at something that looks
like a keyword, then it is a keyword."
(let ((prev (funcall smie-backward-token-function)))
(if (zerop (length prev))
(looking-back "\\s(" (1- (point)))
(looking-back "\\`\\|\\s(" (1- (point)))
(assoc prev smie-grammar))))
(defun sh-smie--newline-semi-p (&optional tok)
......@@ -1804,12 +1804,14 @@ Does not preserve point."
(setq prev (funcall smie-backward-token-function))
(cond
((zerop (length prev))
(if newline
(progn (cl-assert words) (setq res 'word))
(cond
(newline (cl-assert words) (setq res 'word))
((bobp) (setq res 'word))
(t
(setq words t)
(condition-case nil
(forward-sexp -1)
(scan-error (setq res 'unknown)))))
(scan-error (setq res 'unknown))))))
((equal prev ";")
(if words (setq newline t)
(setq res 'keyword)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment