bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Augusto Stoffel
Subject: bug#59888: [PATCH] Add 'grep-heading-mode'
Date: Fri, 09 Dec 2022 12:58:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

On Fri,  9 Dec 2022 at 09:23, Juri Linkov wrote:

>>> 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.

The variable has to be set at the moment `grep-mode' runs, while a minor
mode could be set at a later point.  But I agree a variable is
sufficient here, so I will make this change.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]