emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 22ebde6: Store the regexp just when there are match


From: Tino Calancha
Subject: [Emacs-diffs] master 22ebde6: Store the regexp just when there are matches
Date: Thu, 24 Aug 2017 11:26:16 -0400 (EDT)

branch: master
commit 22ebde63c9df6a6815359c1e3406baddec1ed55b
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    Store the regexp just when there are matches
    
    * lisp/hi-lock.el (hi-lock-set-pattern): When font-lock-mode is
    disabled and there are no matches do not store REGEXP
    in hi-lock-interactive-patterns.
---
 lisp/hi-lock.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 3430021..36901c3 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -721,7 +721,9 @@ with completion and history."
                 (overlay-put overlay 'face face))
               (goto-char (match-end 0)))
             (when no-matches
-              (add-to-list 'hi-lock--unused-faces (face-name face)))))))))
+              (add-to-list 'hi-lock--unused-faces (face-name face))
+              (setq hi-lock-interactive-patterns
+                    (cdr hi-lock-interactive-patterns)))))))))
 
 (defun hi-lock-set-file-patterns (patterns)
   "Replace file patterns list with PATTERNS and refontify."



reply via email to

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