Subject: bug#51580: hl-line-mode doesn't override global-hl-line-mode in current buffer

From: Gregory Heytings <[email-masked]>
Date: Wed, 03 Nov 2021 11:51:49 +0000

And of course this could become a command:

(defun buffer-toggle-global-hl-line-mode ()
   (interactive)
   (make-variable-buffer-local 'global-hl-line-mode)
   (if global-hl-line-mode
       (global-hl-line-unhighlight)
     (global-hl-line-highlight))
   (setq global-hl-line-mode (not global-hl-line-mode)))