diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-02-11 16:37:49 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2015-02-11 16:37:49 -0500 |
commit | 517fc7b612344535087dc54178bd464fe9a74d1f (patch) | |
tree | 5c482c208d15f8680f70e038ec23f4e7e8253f91 /lisp/hi-lock.el | |
parent | 4fb5565d0a0cd9640a242028c92b8b4e2bd4683e (diff) | |
download | emacs-517fc7b612344535087dc54178bd464fe9a74d1f.tar.gz |
* 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.
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r-- | lisp/hi-lock.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 65a4561e3ab..d74664a845f 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -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 |