1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

* lisp/hi-lock.el: Don't call font-lock-remove-keywords if not needed.

Fixes: debbugs:19737

(hi-lock-unface-buffer): Don't call font-lock-remove-keywords if not needed.
This commit is contained in:
Stefan Monnier 2015-02-11 16:37:49 -05:00
parent 4fb5565d0a
commit 517fc7b612
2 changed files with 14 additions and 5 deletions

View file

@ -596,7 +596,12 @@ then remove all hi-lock highlighting."
;; Make `face' the next one to use by default.
(when (symbolp face) ;Don't add it if it's a list (bug#13297).
(add-to-list 'hi-lock--unused-faces (face-name face))))
(font-lock-remove-keywords nil (list keyword))
;; FIXME: Calling `font-lock-remove-keywords' causes
;; `font-lock-specified-p' to go from nil to non-nil (because it
;; calls font-lock-set-defaults). This is yet-another bug in
;; font-lock-add/remove-keywords, which we circumvent here by
;; testing `font-lock-fontified' (bug#19737).
(if font-lock-fontified (font-lock-remove-keywords nil (list keyword)))
(setq hi-lock-interactive-patterns
(delq keyword hi-lock-interactive-patterns))
(remove-overlays