unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: 41195@debbugs.gnu.org
Subject: bug#41195: 27.0.91; Using syntax-ppss-flush-cache in syntax-propertize-function infloops
Date: Tue, 12 May 2020 02:32:37 +0300	[thread overview]
Message-ID: <1d616b0d-3e1b-5f72-da35-d0aa056322b4@yandex.ru> (raw)

In theory, syntax-propertize-function implementations shouldn't change
buffer syntax the way that would affect the current syntax-ppss cache.
Or if they do, they should clear the cache accordingly.

Unfortunately, using syntax-ppss-flush-cache for that purpose doesn't
work: it makes Emacs infloop.

To reproduce, apply this patch:

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 5ec3e94275..efe38049ab 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -2362,6 +2362,7 @@ js-syntax-propertize
                             (eval-when-compile (append "=({[,:;" 
'(nil))))))
             (put-text-property (match-beginning 1) (match-end 1)
                                'syntax-table (string-to-syntax "\"/"))
+           (syntax-ppss-flush-cache (match-beginning 0))
             (js-syntax-propertize-regexp end)))))
      ("\`\(#\)!" (1 "< b"))
      ("<" (0 (ignore

and then edit a file with js-mode containing

   a = /xyz/





             reply	other threads:[~2020-05-11 23:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 23:32 Dmitry Gutov [this message]
2020-05-12 20:55 ` bug#41195: 27.0.91; Using syntax-ppss-flush-cache in syntax-propertize-function infloops Stefan Monnier
2020-05-12 21:05   ` 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=1d616b0d-3e1b-5f72-da35-d0aa056322b4@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=41195@debbugs.gnu.org \
    /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).