From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#59888: [PATCH] Add 'grep-heading-mode' Date: Fri, 09 Dec 2022 09:28:53 +0200 Organization: LINKOV.NET Message-ID: <86bkodkpwa.fsf@mail.linkov.net> References: <87v8mndrla.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33298"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 59888@debbugs.gnu.org To: Augusto Stoffel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 08:44:57 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3Y41-0008UO-Jp for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 08:44:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3Y3D-0002Wg-6K; Fri, 09 Dec 2022 02:44:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3Y3A-0002SS-LN for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:44:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3Y3A-0004qS-CN for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:44:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3Y3A-0004B2-8D for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:44:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 07:44:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59888 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59888-submit@debbugs.gnu.org id=B59888.167057182115974 (code B ref 59888); Fri, 09 Dec 2022 07:44:04 +0000 Original-Received: (at 59888) by debbugs.gnu.org; 9 Dec 2022 07:43:41 +0000 Original-Received: from localhost ([127.0.0.1]:34355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Y2m-00049a-Lq for submit@debbugs.gnu.org; Fri, 09 Dec 2022 02:43:40 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:45845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Y2l-000498-GC for 59888@debbugs.gnu.org; Fri, 09 Dec 2022 02:43:39 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 81CBF1BF205; Fri, 9 Dec 2022 07:43:31 +0000 (UTC) In-Reply-To: <87v8mndrla.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 07 Dec 2022 18:57:37 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250363 Archived-At: > 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.