From 137f57c81e368013e62fcd6f0c6489e6363f65e7 Mon Sep 17 00:00:00 2001 From: E Sabof Date: Fri, 20 Dec 2013 21:47:01 +0200 Subject: [PATCH] * lisp/hi-lock.el (hi-lock-set-pattern): Check for `font-lock-specified-p'. Fixes: debbugs:14179 --- lisp/ChangeLog | 5 +++++ lisp/hi-lock.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3286c90caed..a5447fb5624 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-12-20 E Sabof (tiny change) + + * hi-lock.el (hi-lock-set-pattern): Check for `font-lock-specified-p'. + (Bug#14179) + 2013-12-20 Stephen Berman * calendar/todo-mode.el: New implementation of item insertion diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 37ca83cba31..bb5c54e7152 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -719,7 +719,7 @@ Otherwise, read face name from minibuffer with completion and history." ;; Refuse to highlight a text that is already highlighted. (unless (assoc regexp hi-lock-interactive-patterns) (push pattern hi-lock-interactive-patterns) - (if font-lock-mode + (if (and font-lock-mode (font-lock-specified-p major-mode)) (progn (font-lock-add-keywords nil (list pattern) t) (font-lock-fontify-buffer)) -- 2.39.2