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: Juri Linkov
Subject: bug#59888: [PATCH] Add 'grep-heading-mode'
Date: Fri, 09 Dec 2022 09:28:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

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

Thanks, this would be a great addition.

> +(defface grep-heading '((t :inherit font-lock-function-name-face))
> +  "Face of headings when using `grep-heading-mode'.")

I suggest to keep the existing color scheme, thus inheriting from
compilation-info.  This is the same color used by both grep.el and
xref.el by default.

> +(defvar grep--heading-format
> +  #("\n%s\n" 1 3 (font-lock-face grep-heading outline-level 1))

xref.el doesn't insert extra newlines between file sections.
It would be nice to keep the output closer to the existing
output in xref buffers.





reply via email to

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