]> code.delx.au - gnu-emacs/blobdiff - lisp/hi-lock.el
xref-find-definitions: Exclude more generic function items.
[gnu-emacs] / lisp / hi-lock.el
index 98a26dd463487c855b81024fcff609bd3893ea73..0255585f5321c0985b40c3699ca03b8609babf48 100644 (file)
@@ -1,6 +1,6 @@
 ;;; hi-lock.el --- minor mode for interactive automatic highlighting  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2000-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2015 Free Software Foundation, Inc.
 
 ;; Author: David M. Koppelman <koppel@ece.lsu.edu>
 ;; Keywords: faces, minor-mode, matching, display
@@ -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#19796).
+      (if font-lock-fontified (font-lock-remove-keywords nil (list keyword)))
       (setq hi-lock-interactive-patterns
             (delq keyword hi-lock-interactive-patterns))
       (remove-overlays