unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 22960@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	[thread overview]
Message-ID: <jwvmvpx24os.fsf-monnier+bug#22960@gnu.org> (raw)
In-Reply-To: <86io0vd5sa.fsf@yandex.ru> (Dmitry Gutov's message of "Wed, 09 Mar 2016 17:34:13 +0200")

> 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)





  reply	other threads:[~2016-03-17  2:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 15:34 bug#22960: 25.0.92; smie-indent-keyword triggers the "Bumped into unknown token" error Dmitry Gutov
2016-03-17  2:56 ` Stefan Monnier [this message]
2016-03-17 12:48   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jwvmvpx24os.fsf-monnier+bug#22960@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=22960@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).