diff options
author | Juri Linkov <juri@linkov.net> | 2024-06-20 19:49:30 +0300 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2024-06-20 19:49:30 +0300 |
commit | a6296fda5ee4d54902f23028948643e1ac0de320 (patch) | |
tree | 29183f1580cb307d068d34fab4b14b066ff87392 /lisp | |
parent | 6c85b0311127332621e79217e7a208b679c89d5a (diff) | |
download | emacs-a6296fda5ee4d54902f23028948643e1ac0de320.tar.gz emacs-a6296fda5ee4d54902f23028948643e1ac0de320.tar.bz2 emacs-a6296fda5ee4d54902f23028948643e1ac0de320.zip |
* lisp/hi-lock.el (hi-lock-revert-buffer-rehighlight): Restore same faces.
After reverting the buffer apply all previous patterns with exactly
the same faces as were assigned to patterns before.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/hi-lock.el | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 3c26cc84509..64b84cdf859 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -868,11 +868,10 @@ SPACES-REGEXP is a regexp to substitute spaces in font-lock search." Apply the previous patterns after reverting the buffer." (when-let ((patterns hi-lock-interactive-lighters)) (lambda () - (setq hi-lock-interactive-lighters nil - hi-lock-interactive-patterns nil) - (let ((hi-lock-auto-select-face t)) - (dolist (pattern (reverse patterns)) - (highlight-regexp (car pattern) (hi-lock-read-face-name))))))) + (when hi-lock-interactive-lighters + (hi-lock-unface-buffer t)) + (dolist (pattern (reverse patterns)) + (highlight-regexp (car pattern) (cadr (nth 1 (caddr pattern)))))))) (defvar hi-lock--hashcons-hash (make-hash-table :test 'equal :weakness t) |