emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 517fc7b: * lisp/hi-lock.el: Don't call font-lock-re


From: Stefan Monnier
Subject: [Emacs-diffs] master 517fc7b: * lisp/hi-lock.el: Don't call font-lock-remove-keywords if not needed.
Date: Wed, 11 Feb 2015 21:37:58 +0000

branch: master
commit 517fc7b612344535087dc54178bd464fe9a74d1f
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * 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.
---
 lisp/ChangeLog  |   12 ++++++++----
 lisp/hi-lock.el |    7 ++++++-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7e45b9d..34e4e9d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-11  Stefan Monnier  <address@hidden>
+
+       * hi-lock.el (hi-lock-unface-buffer): Don't call
+       font-lock-remove-keywords if not needed (bug#19737).
+
 2015-02-11  Nicolas Petton <address@hidden>
 
        * emacs-lisp/seq.el (seq-reverse): Add a backward-compatible
@@ -8,8 +13,7 @@
 
        * frame.el (toggle-frame-maximized, toggle-frame-fullscreen):
        Rename frame parameter `maximized' to `fullscreen-restore'.
-       Restore fullwidth/-height after fullboth state.  Update
-       doc-strings.
+       Restore fullwidth/-height after fullboth state.  Update doc-strings.
 
 2015-02-11  Lars Ingebrigtsen  <address@hidden>
 
@@ -23,8 +27,8 @@
 
        * net/shr.el (shr-use-fonts): New variable.
        (shr-fill-text): Rename from "fold".
-       (shr-pixel-column, shr-pixel-region, shr-string-pixel-width): New
-       functions.
+       (shr-pixel-column, shr-pixel-region, shr-string-pixel-width):
+       New functions.
        (shr-insert): Just insert, don't fill the text.  Filling is now
        done afterwards per display unit.
        (shr-fill-lines, shr-fill-line): New functions to fill text on a
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 65a4561..d74664a 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]