From f99bda12d77d3bdda522d0af0541de681301e694 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 28 Jun 2024 09:42:43 +0300 Subject: [PATCH] * lisp/hi-lock.el: More fixes related to revert-buffer. (hi-lock-set-pattern): Use the same propertized string for 'overlay-put' property to allow 'remove-overlays' to remove it while using 'eq' on the property value. https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg01001.html (cherry picked from commit bf862fc277034b6ada4a4a81dd640e116e6b9312) --- lisp/hi-lock.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index c1b96431c16..f595c92041a 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -769,6 +769,7 @@ SPACES-REGEXP is a regexp to substitute spaces in font-lock search." ;; Hashcons the regexp, so it can be passed to remove-overlays later. (setq regexp (hi-lock--hashcons regexp)) (setq subexp (or subexp 0)) + (when lighter (setq lighter (propertize lighter 'regexp regexp))) (let ((pattern (list (lambda (limit) (let ((case-fold-search case-fold) (search-spaces-regexp spaces-regexp)) @@ -780,10 +781,7 @@ SPACES-REGEXP is a regexp to substitute spaces in font-lock search." (assoc (or lighter regexp) hi-lock-interactive-lighters)) (add-to-list 'hi-lock--unused-faces (face-name face)) (push pattern hi-lock-interactive-patterns) - (push (cons (or (and lighter (propertize lighter 'regexp regexp)) - regexp) - pattern) - hi-lock-interactive-lighters) + (push (cons (or lighter regexp) pattern) hi-lock-interactive-lighters) (if (and font-lock-mode (font-lock-specified-p major-mode) (not hi-lock-use-overlays)) (progn -- 2.39.2