[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.
- bug#59888: [PATCH] Add 'grep-heading-mode', Augusto Stoffel, 2022/12/07
- bug#59888: [PATCH] Add 'grep-heading-mode', Eli Zaretskii, 2022/12/07
- bug#59888: [PATCH] Add 'grep-heading-mode', Stefan Kangas, 2022/12/07
- bug#59888: [PATCH] Add 'grep-heading-mode', Augusto Stoffel, 2022/12/08
- bug#59888: [PATCH] Add 'grep-heading-mode', Juri Linkov, 2022/12/09
- bug#59888: [PATCH] Add 'grep-heading-mode',
Augusto Stoffel <=
- bug#59888: [PATCH] Add 'grep-use-headings', Augusto Stoffel, 2022/12/09
- bug#59888: [PATCH] Add 'grep-use-headings', Eli Zaretskii, 2022/12/09
- bug#59888: [PATCH] Add 'grep-use-headings', Augusto Stoffel, 2022/12/09
- bug#59888: [PATCH] Add 'grep-use-headings', Eli Zaretskii, 2022/12/09
- bug#59888: [PATCH] Add 'grep-use-headings', Augusto Stoffel, 2022/12/10
- bug#59888: [PATCH] Add 'grep-use-headings', Eli Zaretskii, 2022/12/10
- bug#59888: [PATCH] Add 'grep-use-headings', Augusto Stoffel, 2022/12/11
- bug#59888: [PATCH] Add 'grep-use-headings', Juri Linkov, 2022/12/15
- bug#59888: [PATCH] Add 'grep-use-headings', Gregory Heytings, 2022/12/09
- bug#59888: [PATCH] Add 'grep-use-headings', Juri Linkov, 2022/12/10