GNU bug report logs - #22960
25.0.92; smie-indent-keyword triggers the "Bumped into unknown token" error

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Wed, 9 Mar 2016 15:35:01 UTC

Severity: normal

Tags: fixed

Found in version 25.0.92

Fixed in version 25.1

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 22960 <at> debbugs.gnu.org
Subject: bug#22960: 25.0.92; smie-indent-keyword triggers the "Bumped into unknown token" error
Date: Wed, 16 Mar 2016 22:56:45 -0400
> foo_bar(
>    "# coding:koi8-r
>          \xd0\xd2\xcf\xd7\xc5\xd2\xcb\xc1 = 42
>          puts \xd0\xd2\xcf\xd7\xc5\xd2\xcb\xc1")
>
> Try to reindent the second line.  During its execution,

I installed the patch below into emacs-25, which should fix it.


        Stefan


diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 495ba7c..1d8f0cb 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1493,7 +1493,10 @@ should not be computed on the basis of the following token."
                            (let ((endpos (point)))
                              (goto-char pos)
                              (forward-line 1)
-                             (and (equal res (smie-indent-forward-token))
+                             ;; As seen in bug#22960, pos may be inside
+                             ;; a string, and forward-token may then stumble.
+                             (and (ignore-errors
+                                    (equal res (smie-indent-forward-token)))
                                   (eq (point) endpos)))))
                     nil
                   (goto-char pos)




This bug report was last modified 9 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.