Function: global-hl-line-maybe-unhighlight

global-hl-line-maybe-unhighlight is a byte-compiled function defined in hl-line.el.gz.

Signature

(global-hl-line-maybe-unhighlight)

Documentation

Maybe deactivate the Global-Hl-Line overlay on the current line.

Specifically, when global-hl-line-sticky-flag is nil deactivate all such overlays in all buffers except the current one.

Source Code

;; Defined in /usr/src/emacs/lisp/hl-line.el.gz
(defun global-hl-line-maybe-unhighlight ()
  "Maybe deactivate the Global-Hl-Line overlay on the current line.
Specifically, when `global-hl-line-sticky-flag' is nil deactivate
all such overlays in all buffers except the current one."
  (setq global-hl-line-overlays
        (seq-remove (lambda (ov) (not (overlay-buffer ov)))
                    global-hl-line-overlays))
  (mapc (lambda (ov)
	  (let ((ovb (overlay-buffer ov)))
            (when (and (not global-hl-line-sticky-flag)
                       (not (eq ovb (current-buffer)))
                       (not (minibufferp)))
	      (with-current-buffer ovb
                (global-hl-line-unhighlight)))))
        global-hl-line-overlays))