diff options
| author | Alan Mackenzie | 2020-09-19 16:50:27 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2020-09-19 16:50:27 +0000 |
| commit | fd1fe1e1ecb6c68bbdea4bf071166779388174d0 (patch) | |
| tree | 09a3fd5aeba4b410a528b8e74ccd82175aaa1e38 | |
| parent | fcd599bbeaac84113379dedbff4e59910e10e171 (diff) | |
| download | emacs-fd1fe1e1ecb6c68bbdea4bf071166779388174d0.tar.gz emacs-fd1fe1e1ecb6c68bbdea4bf071166779388174d0.zip | |
Add doc to syntax-propertize-function saying it must do a 100% job
and cannot be combined with other ways of applying syntax-table text
properties.
* lisp/emacs-lisp/syntax.el (syntax-propertize-function): Amend doc string.
* doc/lispref/syntax.texi (Syntax Properties): Amend the description of the
variable.
| -rw-r--r-- | doc/lispref/syntax.texi | 9 | ||||
| -rw-r--r-- | lisp/emacs-lisp/syntax.el | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 9eb99a0ac92..b3c77665bae 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -575,6 +575,15 @@ position before @var{end}. However, it should not call | |||
| 575 | @code{syntax-ppss-flush-cache}; so, it is not allowed to call | 575 | @code{syntax-ppss-flush-cache}; so, it is not allowed to call |
| 576 | @code{syntax-ppss} on some position and later modify the buffer at an | 576 | @code{syntax-ppss} on some position and later modify the buffer at an |
| 577 | earlier position. | 577 | earlier position. |
| 578 | |||
| 579 | @strong{Caution:} When this variable is non-@code{nil}, Emacs removes | ||
| 580 | @code{syntax-table} text properties arbitrarily and relies on | ||
| 581 | @code{syntax-propertize-function} to reapply them. Thus if this | ||
| 582 | facility is used at all, the function must apply @strong{all} | ||
| 583 | @code{syntax-table} text properties used by the major mode. In | ||
| 584 | particular, Modes derived from a CC Mode mode must not use this | ||
| 585 | variable, since CC Mode uses other means to apply and remove these | ||
| 586 | text properties. | ||
| 578 | @end defvar | 587 | @end defvar |
| 579 | 588 | ||
| 580 | @defvar syntax-propertize-extend-region-functions | 589 | @defvar syntax-propertize-extend-region-functions |
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index 11cc1988b1f..f4f077264be 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el | |||
| @@ -65,7 +65,12 @@ cannot be handled just by the buffer's syntax-table. | |||
| 65 | The specified function may call `syntax-ppss' on any position | 65 | The specified function may call `syntax-ppss' on any position |
| 66 | before END, but it should not call `syntax-ppss-flush-cache', | 66 | before END, but it should not call `syntax-ppss-flush-cache', |
| 67 | which means that it should not call `syntax-ppss' on some | 67 | which means that it should not call `syntax-ppss' on some |
| 68 | position and later modify the buffer on some earlier position.") | 68 | position and later modify the buffer on some earlier position. |
| 69 | |||
| 70 | Note: When this variable is a function, it must apply _all_ the | ||
| 71 | `syntax-table' properties needed in the given text interval. | ||
| 72 | Using both this function and other means to apply these | ||
| 73 | properties won't work properly.") | ||
| 69 | 74 | ||
| 70 | (defvar syntax-propertize-chunk-size 500) | 75 | (defvar syntax-propertize-chunk-size 500) |
| 71 | 76 | ||