aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorTino Calancha2017-08-25 00:24:59 +0900
committerTino Calancha2017-08-25 00:24:59 +0900
commit22ebde63c9df6a6815359c1e3406baddec1ed55b (patch)
tree1cd957e3b3e18254e0a41de6736fa9ac027c0466 /lisp
parent303481b4ecd7d422653263389f86c83b4a4c855b (diff)
downloademacs-22ebde63c9df6a6815359c1e3406baddec1ed55b.tar.gz
emacs-22ebde63c9df6a6815359c1e3406baddec1ed55b.zip
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.
Diffstat (limited to 'lisp')
-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."
721 (overlay-put overlay 'face face)) 721 (overlay-put overlay 'face face))
722 (goto-char (match-end 0))) 722 (goto-char (match-end 0)))
723 (when no-matches 723 (when no-matches
724 (add-to-list 'hi-lock--unused-faces (face-name face))))))))) 724 (add-to-list 'hi-lock--unused-faces (face-name face))
725 (setq hi-lock-interactive-patterns
726 (cdr hi-lock-interactive-patterns)))))))))
725 727
726(defun hi-lock-set-file-patterns (patterns) 728(defun hi-lock-set-file-patterns (patterns)
727 "Replace file patterns list with PATTERNS and refontify." 729 "Replace file patterns list with PATTERNS and refontify."