From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#41766: Make it possible to change regexp to identify and highlight grep matches via customization Date: Sat, 13 Jun 2020 09:50:16 +0300 Message-ID: <83imfv4fyv.fsf@gnu.org> References: <87h7vkihci.fsf@tcd.ie>,<833674710g.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="35900"; mail-complaints-to="usenet@ciao.gmane.io" Cc: contovob@tcd.ie, 41766@debbugs.gnu.org, dgutov@yandex.ru, juri@linkov.net To: Simon Lang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 13 08:51:11 2020 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 1jk00U-0009DB-4r for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 08:51:10 +0200 Original-Received: from localhost ([::1]:57424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jk00S-0008Ue-Pa for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jun 2020 02:51:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jk00M-0008UY-F9 for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2020 02:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jk00M-0005Lf-5n for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2020 02:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jk00M-0005WG-41 for bug-gnu-emacs@gnu.org; Sat, 13 Jun 2020 02:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jun 2020 06:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41766 X-GNU-PR-Package: emacs Original-Received: via spool by 41766-submit@debbugs.gnu.org id=B41766.159203103521181 (code B ref 41766); Sat, 13 Jun 2020 06:51:02 +0000 Original-Received: (at 41766) by debbugs.gnu.org; 13 Jun 2020 06:50:35 +0000 Original-Received: from localhost ([127.0.0.1]:40768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjzzv-0005VZ-4i for submit@debbugs.gnu.org; Sat, 13 Jun 2020 02:50:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjzzt-0005VM-A8 for 41766@debbugs.gnu.org; Sat, 13 Jun 2020 02:50:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53941) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjzzm-00051m-73; Sat, 13 Jun 2020 02:50:26 -0400 Original-Received: from [176.228.60.248] (port=4468 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jjzzl-0004iv-Jz; Sat, 13 Jun 2020 02:50:26 -0400 In-Reply-To: (message from Simon Lang on Wed, 10 Jun 2020 21:11:09 +0000) 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" Xref: news.gmane.io gmane.emacs.bugs:181902 Archived-At: > From: Simon Lang > CC: "41766@debbugs.gnu.org" <41766@debbugs.gnu.org>, "dgutov@yandex.ru" > , "juri@linkov.net" > Date: Wed, 10 Jun 2020 21:11:09 +0000 > > I now something to the manual, NEWS and changed the doc string + commit msg as advised. I decided on defcustom in the end because this way it is easy for the user to figure out what goes wrong in case he/she modifies grep-command and highlighting is missing. Hope that is fine. > > Pls let me know if there is anything else I need to change. Thanks, a few minor comments below. > +by grep. The matching of the sequences is controlled by > +@code{grep-match-regexp}, which can be customize to accommodate > +different grep programs. ^^^^^^^^^ Typo: should be "customized". Also, "grep" should be "Grep". > +** Grep changes: > + > +*** New variable 'grep-match-regexp' matches grep markers to highlight. > +Grep emits SGR ANSI escape sequences to color its output. The new variable > +'grep-match-regexp' holds the regular expression to match the appropriate > +markers in order to provide highlighting in the source buffer. The variable > +can be customized to accommodate other grep-like tools. Please leave 2 spaces between sentences, per our conventions. > +(defcustom grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m" > + "Regular expression matching grep markers to highlight. > +It matches SGR ANSI escape sequences which are emitted by grep to > +color its output. This variable is used in `grep-filter'." Likewise here.