From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Jose A. Ortega Ruiz" <jao@gnu.org>
Cc: 29767@debbugs.gnu.org
Subject: bug#29767: 26.0.90; Failing auto-fill in message-mode because of bad state (comment-skip-end)
Date: Wed, 03 Jan 2018 23:59:39 -0500 [thread overview]
Message-ID: <jwvk1wy442m.fsf-monnier+bug#29767@gnu.org> (raw)
In-Reply-To: <87ind3zqf2.fsf@imladris> (Jose A. Ortega Ruiz's message of "Mon, 18 Dec 2017 22:17:53 +0100")
> Unfortunately, i cannot reproduce the bug reliably, but these are the
> symptoms:
I think I found the culprit: syntax-propertize relies incorrectly on
syntax-ppss to add syntax-ppss-flush-cache to before-change-functions.
This works fine as long as syntax-ppss is called, but in message-mode
buffers, syntax-propertize is always called but not syntax-ppss (it may
get called depending on the operations you perform, but it's not called
initially, e.g. because font-lock is told not to use the syntax-table to
highlight strings and comments).
The patch below seems to fix it for me. Is it OK to push it to emacs-26?
Stefan
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index a1b70b1869..a0493cc1ba 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -291,6 +291,9 @@ syntax-propertize
;; (message "Needs to syntax-propertize from %s to %s"
;; syntax-propertize--done pos)
(set (make-local-variable 'parse-sexp-lookup-properties) t)
+ (when (< syntax-propertize--done (point-min))
+ (add-hook 'before-change-functions
+ #'syntax-ppss-flush-cache t t))
(save-excursion
(with-silent-modifications
(make-local-variable 'syntax-propertize--done) ;Just in case!
next prev parent reply other threads:[~2018-01-04 4:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 21:17 bug#29767: 26.0.90; Failing auto-fill in message-mode because of bad state (comment-skip-end) Jose A. Ortega Ruiz
2017-12-19 11:52 ` Michael Heerdegen
2017-12-19 16:16 ` Eli Zaretskii
2017-12-20 0:21 ` Katsumi Yamaoka
2017-12-20 0:39 ` Jose Antonio Ortega Ruiz
2017-12-20 0:59 ` Katsumi Yamaoka
2017-12-20 1:20 ` Jose A. Ortega Ruiz
2017-12-20 7:25 ` Katsumi Yamaoka
2017-12-20 17:04 ` Jose A. Ortega Ruiz
2017-12-20 17:16 ` Jose A. Ortega Ruiz
2018-01-03 16:31 ` Tomas Nordin
2018-01-04 19:52 ` Tomas Nordin
2017-12-25 14:38 ` Michael Heerdegen
2018-01-04 4:59 ` Stefan Monnier [this message]
2018-01-10 4:59 ` Katsumi Yamaoka
2018-01-11 3:32 ` Jose A. Ortega Ruiz
2018-01-11 13:41 ` Stefan Monnier
2018-01-12 3:54 ` Katsumi Yamaoka
2018-01-11 15:11 ` Stefan Monnier
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='jwvk1wy442m.fsf-monnier+bug#29767@gnu.org' \
--to=monnier@iro.umontreal.ca \
--cc=29767@debbugs.gnu.org \
--cc=jao@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).