diff options
| author | Stefan Monnier | 2019-05-08 15:18:32 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-05-08 15:18:32 -0400 |
| commit | f97628f58e520c13b70ff618dda34e66da3dc81b (patch) | |
| tree | ae8f6b2dc547c16b19be25b93b68c9392ee18e3c | |
| parent | caa28f031b65ff6512e777f8996d7f3c3144c17a (diff) | |
| download | emacs-f97628f58e520c13b70ff618dda34e66da3dc81b.tar.gz emacs-f97628f58e520c13b70ff618dda34e66da3dc81b.zip | |
* lisp/emacs-lisp/syntax.el (syntax-propertize): `ignore` is like nil
(syntax-ppss-after-change-function): Mark it as obsolete.
* lisp/font-lock.el (font-lock-apply-syntactic-highlight):
Use syntax-ppss-flush-cache instead.
| -rw-r--r-- | lisp/emacs-lisp/syntax.el | 5 | ||||
| -rw-r--r-- | lisp/font-lock.el | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el index d09d6c12254..f1904e64efb 100644 --- a/lisp/emacs-lisp/syntax.el +++ b/lisp/emacs-lisp/syntax.el | |||
| @@ -286,7 +286,7 @@ END) suitable for `syntax-propertize-function'." | |||
| 286 | (defun syntax-propertize (pos) | 286 | (defun syntax-propertize (pos) |
| 287 | "Ensure that syntax-table properties are set until POS (a buffer point)." | 287 | "Ensure that syntax-table properties are set until POS (a buffer point)." |
| 288 | (when (< syntax-propertize--done pos) | 288 | (when (< syntax-propertize--done pos) |
| 289 | (if (null syntax-propertize-function) | 289 | (if (memq syntax-propertize-function '(nil ignore)) |
| 290 | (setq syntax-propertize--done (max (point-max) pos)) | 290 | (setq syntax-propertize--done (max (point-max) pos)) |
| 291 | ;; (message "Needs to syntax-propertize from %s to %s" | 291 | ;; (message "Needs to syntax-propertize from %s to %s" |
| 292 | ;; syntax-propertize--done pos) | 292 | ;; syntax-propertize--done pos) |
| @@ -404,7 +404,8 @@ These are valid when the buffer has no restriction.") | |||
| 404 | (defvar-local syntax-ppss-narrow-start nil | 404 | (defvar-local syntax-ppss-narrow-start nil |
| 405 | "Start position of the narrowing for `syntax-ppss-narrow'.") | 405 | "Start position of the narrowing for `syntax-ppss-narrow'.") |
| 406 | 406 | ||
| 407 | (defalias 'syntax-ppss-after-change-function 'syntax-ppss-flush-cache) | 407 | (define-obsolete-function-alias 'syntax-ppss-after-change-function |
| 408 | #'syntax-ppss-flush-cache "27.1") | ||
| 408 | (defun syntax-ppss-flush-cache (beg &rest ignored) | 409 | (defun syntax-ppss-flush-cache (beg &rest ignored) |
| 409 | "Flush the cache of `syntax-ppss' starting at position BEG." | 410 | "Flush the cache of `syntax-ppss' starting at position BEG." |
| 410 | ;; Set syntax-propertize to refontify anything past beg. | 411 | ;; Set syntax-propertize to refontify anything past beg. |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index d0f7096ab8b..7ff4e606fa6 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1501,7 +1501,7 @@ see `font-lock-syntactic-keywords'." | |||
| 1501 | ;; Flush the syntax-cache. I believe this is not necessary for | 1501 | ;; Flush the syntax-cache. I believe this is not necessary for |
| 1502 | ;; font-lock's use of syntax-ppss, but I'm not 100% sure and it can | 1502 | ;; font-lock's use of syntax-ppss, but I'm not 100% sure and it can |
| 1503 | ;; still be necessary for other users of syntax-ppss anyway. | 1503 | ;; still be necessary for other users of syntax-ppss anyway. |
| 1504 | (syntax-ppss-after-change-function start) | 1504 | (syntax-ppss-flush-cache start) |
| 1505 | (cond | 1505 | (cond |
| 1506 | ((not override) | 1506 | ((not override) |
| 1507 | ;; Cannot override existing fontification. | 1507 | ;; Cannot override existing fontification. |