summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/syntax.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2018-01-11 10:11:39 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2018-01-11 10:11:39 -0500
commitdbb4aac212833035203efb969339b71aff86f2ea (patch)
tree21bdb30a3b4804c8d2781cedd569e30a3266a9e9 /lisp/emacs-lisp/syntax.el
parent80463a43da2f23717400250b054afee243df950c (diff)
downloademacs-dbb4aac212833035203efb969339b71aff86f2ea.tar.gz
* lisp/emacs-lisp/syntax.el (syntax-propertize): Fix bug#29767
Diffstat (limited to 'lisp/emacs-lisp/syntax.el')
-rw-r--r--lisp/emacs-lisp/syntax.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index a1b70b18693..6106720f7a5 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -291,6 +291,14 @@ END) suitable for `syntax-propertize-function'."
;; (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))
+ ;; *Usually* syntax-propertize is called via syntax-ppss which
+ ;; takes care of adding syntax-ppss-flush-cache to b-c-f, but this
+ ;; is not *always* the case, so since we share a single "flush" function
+ ;; between syntax-ppss and syntax-propertize, we also have to make
+ ;; sure the flush function is installed here (bug#29767).
+ (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!