emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 21beb19: (font-lock-ensure-function): Fix bug#223


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-25 21beb19: (font-lock-ensure-function): Fix bug#22399
Date: Mon, 25 Jan 2016 14:28:42 +0000

branch: emacs-25
commit 21beb19d80b6aba2c2b736b3e1d031f1ef0e743d
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    (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).
---
 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 3c1f01d..6f94f35 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1074,7 +1074,13 @@ accessible portion of the current buffer."
 
 (defvar font-lock-ensure-function
   (lambda (_beg _end)
-    (unless font-lock-fontified (font-lock-default-fontify-buffer)))
+    (unless font-lock-fontified
+      (font-lock-default-fontify-buffer)
+      (unless font-lock-mode
+        ;; If font-lock is not enabled, we don't have the hooks in place to
+        ;; track modifications, so a subsequent call to font-lock-ensure can't
+        ;; assume that the fontification is still valid.
+        (setq font-lock-fontified nil))))
   "Function to make sure a region has been fontified.
 Called with two arguments BEG and END.")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]