GNU bug report logs - #59888
[PATCH] Add 'grep-heading-mode'

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Wed, 7 Dec 2022 17:58:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 59888 <at> debbugs.gnu.org
Subject: bug#59888: [PATCH] Add 'grep-heading-mode'
Date: Thu, 08 Dec 2022 10:06:58 +0100
On Wed,  7 Dec 2022 at 16:19, Stefan Kangas wrote:

> Augusto Stoffel <arstoffel <at> gmail.com> writes:
>
>> From 2247f006845000032fedc3dda9a073b14043a270 Mon Sep 17 00:00:00 2001
>> From: Augusto Stoffel <arstoffel <at> gmail.com>
>> Date: Wed, 7 Dec 2022 18:44:07 +0100
>> Subject: [PATCH] Add 'grep-heading-mode'
>>
>> New minor mode to subdivide grep output into sections, as in the
>> '--heading' option of certain grep-like programs.
>>
>> * lisp/progmodes/grep.el (grep-heading-regexp): New user option.
>> (grep-heading): New face.
>> (grep--heading-format, grep--current-heading, grep--heading-filter):
>> Filter function for grep processes and supporting variables.
>> (grep-heading-mode): New minor mode.
>
> 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.




This bug report was last modified 2 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.