diff options
| author | Stefan Monnier | 2016-01-25 09:28:37 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2016-01-25 09:28:37 -0500 |
| commit | 21beb19d80b6aba2c2b736b3e1d031f1ef0e743d (patch) | |
| tree | 498a16ba0ae35a4f28fcb5778919537704e47eff | |
| parent | ec90220ac1bd81437654d07b769819e1dcd24de5 (diff) | |
| download | emacs-21beb19d80b6aba2c2b736b3e1d031f1ef0e743d.tar.gz emacs-21beb19d80b6aba2c2b736b3e1d031f1ef0e743d.zip | |
(font-lock-ensure-function): Fix bug#22399
* lisp/font-lock.el (font-lock-ensure-function): Fix handling when
font-lock-mode is not enabled (bug#22399).
| -rw-r--r-- | lisp/font-lock.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 3c1f01d5886..6f94f353c90 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1074,7 +1074,13 @@ accessible portion of the current buffer." | |||
| 1074 | 1074 | ||
| 1075 | (defvar font-lock-ensure-function | 1075 | (defvar font-lock-ensure-function |
| 1076 | (lambda (_beg _end) | 1076 | (lambda (_beg _end) |
| 1077 | (unless font-lock-fontified (font-lock-default-fontify-buffer))) | 1077 | (unless font-lock-fontified |
| 1078 | (font-lock-default-fontify-buffer) | ||
| 1079 | (unless font-lock-mode | ||
| 1080 | ;; If font-lock is not enabled, we don't have the hooks in place to | ||
| 1081 | ;; track modifications, so a subsequent call to font-lock-ensure can't | ||
| 1082 | ;; assume that the fontification is still valid. | ||
| 1083 | (setq font-lock-fontified nil)))) | ||
| 1078 | "Function to make sure a region has been fontified. | 1084 | "Function to make sure a region has been fontified. |
| 1079 | Called with two arguments BEG and END.") | 1085 | Called with two arguments BEG and END.") |
| 1080 | 1086 | ||