Subject: bug#77022: closed (Re: bug#77022: [PATCH] Allow specify in which major modes global-hl-line-mode must be enabled.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 20 Mar 2025 13:07:02 +0000

Your bug report

#77022: [PATCH] Allow specify in which major modes global-hl-line-mode must be enabled.

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
77022: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77022
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#77022: [PATCH] Allow specify in which major modes global-hl-line-mode must be enabled.
From: Eli Zaretskii <[email-masked]>
To: Elijah Gabe Pérez <[email-masked]>
Cc: [email-masked]
Date: Thu, 20 Mar 2025 15:05:47 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Elijah Gabe Pérez <[email-masked]>
> Cc: [email-masked]
> Date: Sat, 15 Mar 2025 12:35:37 -0600
> 
> Eli Zaretskii <[email-masked]> writes: 
> 
>  +(defcustom global-hl-line-modes t + "Which major modes `hl-line-mode' is switched on in. +This
>  variable can be either t (all major modes), nil (no major modes), +or a list of modes and (not modes) to
>  switch use this minor mode or +not. For instance + + (c-mode (not message-mode mail-mode)
>  text-mode) + +means \"use this mode in all modes derived from `c-mode', don't use in +modes derived
>  from `message-mode' or `mail-mode', but do use in other +modes derived from `text-mode'\". An
>  element with value t means \"use\" +and nil means \"don't use\". There's an implicit nil at the end of the
>  +list." + :type + '(choice (const :tag "Enable in all major modes" t) + (const :tag "Don't enable in any
>  major mode" nil) 
> 
>  Why is it useful to have a value of nil here? Why would anyone activate this mode when the variable
>  has the value nil? 
> 
> Well, this is extracted by expanding define-globalized-minor-mode macro, I've deleted them (i'm wondering
> why that macro adds them since i find them unnecessaries) 
> 
>  @@ -224,7 +254,8 @@ global-hl-line-mode on `post-command-hook'." :global t :group 'hl-line - (if
>  global-hl-line-mode + (if (and global-hl-line-mode + (easy-mmode–globalized-predicate-p
>  global-hl-line-modes)) (progn ;; In case `kill-all-local-variables' is called. (add-hook
>  'change-major-mode-hook #'global-hl-line-unhighlight) 
> 
>  Maybe I'm missing something, but don't you need to consult this new variable in
>  global-hl-line-highlight-all? 
> 
> I've moved it to global-hl-line-highlight, which should work better. 

Thanks, installed on master, and closing the bug.

Subject: [PATCH] Allow specify in which major modes global-hl-line-mode must be enabled.
From: Elijah Gabe Pérez <[email-masked]>
To: [email-masked]
Date: Fri, 14 Mar 2025 19:22:33 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello, this patch add a user option for specify in which major modes
should global-hl-line-mode be switched on.

Originally i wanted to replace global-hl-line define-minor-mode
definition with define-globalized-minor-mode, however i found that this
was already done and was reverted in
*a34afbf2aea2fdaf691f4bf250a18991b21301d7* commit, so I decided to bring
this feature, since i find this better than using add-hook.

-- 
                                          - E.G via GNU Emacs and Org.