GNU bug report logs -
#15826
24.3.50; SMIE hangs in sh-mode
Previous Next
Reported by: Aaron Ecay <aaronecay <at> gmail.com>
Date: Thu, 7 Nov 2013 03:57:02 UTC
Severity: normal
Found in version 24.3.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #10 received at 15826-done <at> debbugs.gnu.org (full text, mbox):
> - emacs -Q
> - C-x C-f foo.sh
> - type “for i in”
> - immediately after entering the ‘n’, emacs will hang
Indeed, thank you. I installed the patch below which should fix it.
Stefan
=== modified file 'lisp/progmodes/sh-script.el'
--- lisp/progmodes/sh-script.el 2013-10-24 21:16:20 +0000
+++ lisp/progmodes/sh-script.el 2013-11-08 04:31:52 +0000
@@ -1730,7 +1730,7 @@
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 @@
(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)))
This bug report was last modified 11 years and 278 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.