mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
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.
This commit is contained in:
parent
2058ed65fb
commit
9af2ecc36d
2 changed files with 42 additions and 1 deletions
|
|
@ -695,7 +695,8 @@ with completion and history."
|
|||
(setq regexp (hi-lock--hashcons regexp))
|
||||
(let ((pattern (list regexp (list 0 (list 'quote face) 'prepend))))
|
||||
;; Refuse to highlight a text that is already highlighted.
|
||||
(unless (assoc regexp hi-lock-interactive-patterns)
|
||||
(if (assoc regexp hi-lock-interactive-patterns)
|
||||
(add-to-list 'hi-lock--unused-faces (face-name face))
|
||||
(push pattern hi-lock-interactive-patterns)
|
||||
(if (and font-lock-mode (font-lock-specified-p major-mode))
|
||||
(progn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue