aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorTino Calancha2017-04-27 12:01:19 +0900
committerTino Calancha2017-04-27 12:01:19 +0900
commit9af2ecc36d1d15bb63fb6b28a9b5baa6990f79b8 (patch)
tree0ebd547d5aa6cc21b7afa6098e1565ecd834ec9f /lisp
parent2058ed65fba79ecdbda6604683540bf9f9860bae (diff)
downloademacs-9af2ecc36d1d15bb63fb6b28a9b5baa6990f79b8.tar.gz
emacs-9af2ecc36d1d15bb63fb6b28a9b5baa6990f79b8.zip
Drop face from hi-lock--unused-faces only when used
* lisp/hi-lock.el (hi-lock-set-pattern): If REGEXP is already highlighted, then push FACE into hi-lock--unused-faces (Bug#26666). * test/lisp/hi-lock-tests.el (hi-lock-bug26666): Add test.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/hi-lock.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index ebd18621ef9..5139e01fa84 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -695,7 +695,8 @@ with completion and history."
695 (setq regexp (hi-lock--hashcons regexp)) 695 (setq regexp (hi-lock--hashcons regexp))
696 (let ((pattern (list regexp (list 0 (list 'quote face) 'prepend)))) 696 (let ((pattern (list regexp (list 0 (list 'quote face) 'prepend))))
697 ;; Refuse to highlight a text that is already highlighted. 697 ;; Refuse to highlight a text that is already highlighted.
698 (unless (assoc regexp hi-lock-interactive-patterns) 698 (if (assoc regexp hi-lock-interactive-patterns)
699 (add-to-list 'hi-lock--unused-faces (face-name face))
699 (push pattern hi-lock-interactive-patterns) 700 (push pattern hi-lock-interactive-patterns)
700 (if (and font-lock-mode (font-lock-specified-p major-mode)) 701 (if (and font-lock-mode (font-lock-specified-p major-mode))
701 (progn 702 (progn