emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master aa94f91 20/25: Be more careful when disabling/enabling fon


From: Jackson Ray Hamilton
Subject: [elpa] master aa94f91 20/25: Be more careful when disabling/enabling font-lock.
Date: Mon, 30 May 2016 22:10:45 +0000 (UTC)

branch: master
commit aa94f91c85ae53724aa40419b8fd5784b4dd544b
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Be more careful when disabling/enabling font-lock.
---
 context-coloring.el |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index a20bfa6..9c2be91 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -419,16 +419,15 @@ Feature inspired by Douglas Crockford."
   nil " Context" nil
   (cond
    (context-coloring-mode
-    ;; Font lock is incompatible with this mode; the converse is also true.
-    (font-lock-mode 0)
-    (jit-lock-mode nil)
-    ;; ...but we do use font-lock functions here.
-    (font-lock-set-defaults)
-    ;; Safely change the value of this function as necessary.
-    (make-local-variable 'font-lock-syntactic-face-function)
     (let ((dispatch (context-coloring-get-current-dispatch)))
       (cond
        (dispatch
+        ;; Font lock is incompatible with this mode; the converse is also true.
+        (font-lock-mode 0)
+        ;; ...but we do use font-lock functions here.
+        (font-lock-set-defaults)
+        ;; Safely change the value of this function as necessary.
+        (make-local-variable 'font-lock-syntactic-face-function)
         (let ((setup (plist-get dispatch :setup)))
           (when setup
             (funcall setup))
@@ -443,8 +442,7 @@ Feature inspired by Douglas Crockford."
         (let ((teardown (plist-get dispatch :teardown)))
           (when teardown
             (funcall teardown)))))
-    (font-lock-mode)
-    (jit-lock-mode t))))
+    (turn-on-font-lock-if-desired))))
 
 (provide 'context-coloring)
 



reply via email to

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