aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2025-09-17 19:20:18 +0300
committerJuri Linkov2025-09-17 19:20:18 +0300
commiteacaae81237d8f4e30045c663cae687473e3f327 (patch)
tree7334fd2833fcf9499f195a74b0232d32bd6435f6
parentde4ca2bdb1ae69a6ad0c4fc0473f2823e74f7f2b (diff)
downloademacs-eacaae81237d8f4e30045c663cae687473e3f327.tar.gz
emacs-eacaae81237d8f4e30045c663cae687473e3f327.zip
* lisp/hl-line.el: Various fixes (bug#64993).
(hl-line-face): Move 'global-hl-line-overlay' updates to the loop over buffers since it's a buffer-local variable. (global-hl-line-maybe-unhighlight): Remove obsolete overlays from 'global-hl-line-overlays'.
-rw-r--r--lisp/hl-line.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index ab9dab71823..bebccbf942d 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -88,9 +88,9 @@ when `global-hl-line-sticky-flag' is non-nil.")
88 (dolist (buffer (buffer-list)) 88 (dolist (buffer (buffer-list))
89 (with-current-buffer buffer 89 (with-current-buffer buffer
90 (when (overlayp hl-line-overlay) 90 (when (overlayp hl-line-overlay)
91 (overlay-put hl-line-overlay 'face hl-line-face)))) 91 (overlay-put hl-line-overlay 'face hl-line-face))
92 (when (overlayp global-hl-line-overlay) 92 (when (overlayp global-hl-line-overlay)
93 (overlay-put global-hl-line-overlay 'face hl-line-face)))) 93 (overlay-put global-hl-line-overlay 'face hl-line-face))))))
94 94
95(defcustom hl-line-sticky-flag t 95(defcustom hl-line-sticky-flag t
96 "Non-nil means the HL-Line mode highlight appears in all windows. 96 "Non-nil means the HL-Line mode highlight appears in all windows.
@@ -310,10 +310,12 @@ on `post-command-hook'."
310 "Maybe deactivate the Global-Hl-Line overlay on the current line. 310 "Maybe deactivate the Global-Hl-Line overlay on the current line.
311Specifically, when `global-hl-line-sticky-flag' is nil deactivate 311Specifically, when `global-hl-line-sticky-flag' is nil deactivate
312all such overlays in all buffers except the current one." 312all such overlays in all buffers except the current one."
313 (setq global-hl-line-overlays
314 (seq-remove (lambda (ov) (not (overlay-buffer ov)))
315 global-hl-line-overlays))
313 (mapc (lambda (ov) 316 (mapc (lambda (ov)
314 (let ((ovb (overlay-buffer ov))) 317 (let ((ovb (overlay-buffer ov)))
315 (when (and (not global-hl-line-sticky-flag) 318 (when (and (not global-hl-line-sticky-flag)
316 (bufferp ovb)
317 (not (eq ovb (current-buffer))) 319 (not (eq ovb (current-buffer)))
318 (not (minibufferp))) 320 (not (minibufferp)))
319 (with-current-buffer ovb 321 (with-current-buffer ovb