]> git.eshelyaron.com Git - emacs.git/commit
* lisp/emacs-lisp/syntax.el: Rework the handling of nested calls.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 26 Jun 2022 12:59:38 +0000 (08:59 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 26 Jun 2022 12:59:38 +0000 (08:59 -0400)
commit6a96d1773469e671a3d5710bedf68c21929b5183
treec46a211c41d16f8df54a31447994330fd03acb91
parent502e861af75e32152346f17f034c92a0550ccea3
* lisp/emacs-lisp/syntax.el: Rework the handling of nested calls.

Nested calls to `syntax-ppss` and `syntax-propertize` can easily
happen unexpectedly via ondemand propertizing or `forward-sexp`.
Refine the handling of nested calls so we detect them more reliably
(e.g. also within `syntax-propertize-extend-region-functions`)
and so that the `syntax-ppss` cache is automatically flushed in case
it might have been filled with data that's become obsolete since.

(syntax-propertize--inhibit-flush): Delete var.
(syntax-propertize--in-process-p): New function to replace it.
(syntax-ppss-flush-cache): Use it.
(syntax-ppss--updated-cache): New var.
(syntax-propertize): Make `syntax-propertize--done` binding apply to
`syntax-propertize-extend-region-functions` as well, as intended (fixes
bug#46713).  Use `syntax-ppss--updated-cache` to flush
syntax-ppss cache at the end when needed.
Don't bind `syntax-propertize--inhibit-flush` any more.
(syntax-ppss): Set `syntax-ppss--updated-cache` when applicable.
lisp/emacs-lisp/syntax.el