Fix hl-line-mode/global-hl-line-mode logic again

* lisp/hl-line.el (hl-line-mode): Make explicit calls to
(hl-line-mode 1) work again when global-hl-line-mode is on
(bug#58478).
This commit is contained in:
Lars Ingebrigtsen 2022-10-13 10:08:55 +02:00
parent 4af4df18c5
commit 12f261c470

View file

@ -156,7 +156,8 @@ line about point in the selected window only."
:group 'hl-line
;; If the global mode is switched on, then `M-x hl-line-mode' should
;; switch the mode off in this buffer.
(when global-hl-line-mode
(when (and global-hl-line-mode
(eq arg 'toggle))
(setq hl-line-mode nil)
(setq-local global-hl-line-mode nil)
(global-hl-line-unhighlight))