diff options
| author | Philipp Stephani | 2021-05-30 22:39:54 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2021-05-30 22:42:40 +0200 |
| commit | ed72a8ccd5e32e7752102f223fac12e7ad72709b (patch) | |
| tree | 6c4835ae34cb4def63c80ae2a762afbd1cc79ce4 | |
| parent | 3988411f6c6a1170bca0831874233ff4b739009c (diff) | |
| download | emacs-ed72a8ccd5e32e7752102f223fac12e7ad72709b.tar.gz emacs-ed72a8ccd5e32e7752102f223fac12e7ad72709b.zip | |
Document that the 'syntax-propertize-function' may move point.
The functions generated by 'syntax-propertize-rules' don't use
'save-excursion', but 'syntax-propertize' does, so we might as well
document that the 'syntax-propertize-function' may move point.
* doc/lispref/syntax.texi (Syntax Properties): Document that the
'syntax-propertize-function' may move point.
| -rw-r--r-- | doc/lispref/syntax.texi | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 2df6c15c4ca..bde7075b0df 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -572,12 +572,14 @@ The function is called by @code{syntax-ppss} (@pxref{Position Parse}), | |||
| 572 | and by Font Lock mode during syntactic fontification (@pxref{Syntactic | 572 | and by Font Lock mode during syntactic fontification (@pxref{Syntactic |
| 573 | Font Lock}). It is called with two arguments, @var{start} and | 573 | Font Lock}). It is called with two arguments, @var{start} and |
| 574 | @var{end}, which are the starting and ending positions of the text on | 574 | @var{end}, which are the starting and ending positions of the text on |
| 575 | which it should act. It is allowed to call @code{syntax-ppss} on any | 575 | which it should act. It is allowed to arbitrarily move point within |
| 576 | position before @var{end}, but if a Lisp program calls | 576 | the region delimited by @var{start} and @var{end}; such motions don't |
| 577 | @code{syntax-ppss} on some position and later modifies the buffer at | 577 | need to use @code{save-excursion} (@pxref{Excursions}). It is also |
| 578 | some earlier position, then it is that program's responsibility to | 578 | allowed to call @code{syntax-ppss} on any position before @var{end}, |
| 579 | call @code{syntax-ppss-flush-cache} to flush the now obsolete info | 579 | but if a Lisp program calls @code{syntax-ppss} on some position and |
| 580 | from the cache. | 580 | later modifies the buffer at some earlier position, then it is that |
| 581 | program's responsibility to call @code{syntax-ppss-flush-cache} to | ||
| 582 | flush the now obsolete info from the cache. | ||
| 581 | 583 | ||
| 582 | @strong{Caution:} When this variable is non-@code{nil}, Emacs removes | 584 | @strong{Caution:} When this variable is non-@code{nil}, Emacs removes |
| 583 | @code{syntax-table} text properties arbitrarily and relies on | 585 | @code{syntax-table} text properties arbitrarily and relies on |