* lisp/whitespace.el (whitespace-color-on, whitespace-color-off): Only
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 5 Apr 2013 22:22:12 +0000 (02:22 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 5 Apr 2013 22:22:12 +0000 (02:22 +0400)
call `font-lock-fontify-buffer' when `font-lock-mode' is on.

lisp/ChangeLog
lisp/whitespace.el

index b3073dd..1af9905 100644 (file)
@@ -3,6 +3,11 @@
        * emacs-lisp/package.el (package-compute-transaction): Fix last fix.
        Suggested by Donald Curtis <dcurtis@coe.edu> (bug#14082).
 
+2013-04-05  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * whitespace.el (whitespace-color-on, whitespace-color-off): Only
+       call `font-lock-fontify-buffer' when `font-lock-mode' is on.
+
 2013-04-05  Jacek ChrzÄ…szcz  <chrzaszcz@mimuw.edu.pl> (tiny change)
 
        * ispell.el (ispell-set-spellchecker-params):
index c32155f..68625e0 100644 (file)
@@ -2243,7 +2243,8 @@ resultant list will be returned."
                  (whitespace-space-after-tab-regexp 'space)))
               1 whitespace-space-after-tab t)))))
     (font-lock-add-keywords nil whitespace-font-lock-keywords t)
-    (font-lock-fontify-buffer)))
+    (when font-lock-mode
+      (font-lock-fontify-buffer))))
 
 
 (defun whitespace-color-off ()
@@ -2253,7 +2254,8 @@ resultant list will be returned."
     (remove-hook 'post-command-hook #'whitespace-post-command-hook t)
     (remove-hook 'before-change-functions #'whitespace-buffer-changed t)
     (font-lock-remove-keywords nil whitespace-font-lock-keywords)
-    (font-lock-fontify-buffer)))
+    (when font-lock-mode
+      (font-lock-fontify-buffer))))
 
 
 (defun whitespace-trailing-regexp (limit)