]> git.eshelyaron.com Git - emacs.git/commitdiff
Store the regexp just when there are matches
authorTino Calancha <tino.calancha@gmail.com>
Thu, 24 Aug 2017 15:24:59 +0000 (00:24 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Thu, 24 Aug 2017 15:24:59 +0000 (00:24 +0900)
* 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

index 34300212f02d01711938e30078786d7b7dea5b9d..36901c302d6557555f465044f78a87f34004db5d 100644 (file)
@@ -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."