Subject: bug#59888: [PATCH] Add 'grep-heading-mode'

From: Juri Linkov <[email-masked]>
Date: Fri, 09 Dec 2022 09:23:46 +0200

>> How about making this into a defcustom instead of a minor mode?
>>
>> I'm thinking that something like
>>
>>     (setopt grep-use-headings t)
>>
>> is a slightly simpler interface to use than
>>
>>     (add-hook 'grep-mode-hook 'grep-heading-mode)
>>
>> I also think the former plays a bit better with customize.
>
> This is at the same time less customizable in the sense that something
> like
>
>   (add-hook 'grep-mode-hook
>     (lambda () (when condition) (setq grep-use-headings t)))
>
> will not work (I think), while conditionally activating a minor mode
> certainly works.  But I'm open to both approaches.

Why not?  (setq-local grep-use-headings t) definitely should do
the right thing.