From d695cb94fb71c8c8d4822fbf9d702dbda3252aac Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 6 Apr 2013 02:22:12 +0400 Subject: * lisp/whitespace.el (whitespace-color-on, whitespace-color-off): Only call `font-lock-fontify-buffer' when `font-lock-mode' is on. --- lisp/whitespace.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/whitespace.el') diff --git a/lisp/whitespace.el b/lisp/whitespace.el index c32155f5430..68625e06acb 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -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) -- cgit v1.2.1