summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2017-08-25 00:24:59 +0900
committerTino Calancha <tino.calancha@gmail.com>2017-08-25 00:24:59 +0900
commit22ebde63c9df6a6815359c1e3406baddec1ed55b (patch)
tree1cd957e3b3e18254e0a41de6736fa9ac027c0466
parent303481b4ecd7d422653263389f86c83b4a4c855b (diff)
downloademacs-22ebde63c9df6a6815359c1e3406baddec1ed55b.tar.gz
Store the regexp just when there are matches
* lisp/hi-lock.el (hi-lock-set-pattern): When font-lock-mode is disabled and there are no matches do not store REGEXP in hi-lock-interactive-patterns.
-rw-r--r--lisp/hi-lock.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 34300212f02..36901c302d6 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -721,7 +721,9 @@ with completion and history."
(overlay-put overlay 'face face))
(goto-char (match-end 0)))
(when no-matches
- (add-to-list 'hi-lock--unused-faces (face-name face)))))))))
+ (add-to-list 'hi-lock--unused-faces (face-name face))
+ (setq hi-lock-interactive-patterns
+ (cdr hi-lock-interactive-patterns)))))))))
(defun hi-lock-set-file-patterns (patterns)
"Replace file patterns list with PATTERNS and refontify."