all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Simon Lang <simon.lang@yellowfrog.io>
Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,
	"41766@debbugs.gnu.org" <41766@debbugs.gnu.org>,
	Simon Lang <simon.lang@outlook.com>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#41766: Make it possible to change regexp to identify and highlight grep matches via customization
Date: Mon, 15 Jun 2020 02:08:12 +0300	[thread overview]
Message-ID: <87o8pl9rfn.fsf@mail.linkov.net> (raw)
In-Reply-To: <44423F99-0143-4F4E-A4FC-D29B922A48A2@yellowfrog.io> (Simon Lang's message of "Sun, 14 Jun 2020 10:12:03 +0100")

>> Or for a completely new tool:
>>
>> (nconc (get 'grep-program 'custom-type) '((const :tag "ripgrep" "rg")))
>
> Maybe still fine to merge my patch now and look at this later?
> One would not contradict the other, I would think?

Yes, your patch is a good starting point, thanks.

A minor worry is that you put back defcustom instead of leaving defvar.
I can't imagine a user who might want to customize it using literal
escape characters in the customization input field.

Maybe this is fine for now, but in the long run it would be better to
allow an alist of mappings from the grep program name to its escape sequences
like

(defvar grep-match-regexp
 '(("grep" . "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m")
   ("ripgrep" . ""\033\\[[0-9]*m\033\\[[0-9]*1m\033\\[[0-9]*1m\\(.*?\\)\033\\[[0-9]*0m"")))

Then you can easily switch between grep and ripgrep without losing
information about their escape sequences.

But of course this could be improved after installing your current patch.





  reply	other threads:[~2020-06-14 23:08 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0e6ad4aefa2743f1b0d6ba4315a9e91b@VI1PR10MB2800.EURPRD10.PROD.OUTLOOK.COM>
2020-06-14  9:12 ` bug#41766: Make it possible to change regexp to identify and highlight grep matches via customization Simon Lang
2020-06-14 23:08   ` Juri Linkov [this message]
2020-06-22 19:09     ` Simon Lang
2020-06-22 23:50       ` Juri Linkov
2020-06-08 20:25 Simon Lang
2020-06-08 23:18 ` Juri Linkov
2020-06-09  0:44 ` Dmitry Gutov
2020-06-09  7:58   ` Simon Lang
2020-06-09 11:55     ` Basil L. Contovounesios
2020-06-09 12:45       ` Simon Lang
2020-06-09 14:32         ` Basil L. Contovounesios
2020-06-09 14:43       ` Eli Zaretskii
2020-06-10 21:11         ` Simon Lang
2020-06-10 21:52           ` Juri Linkov
2020-06-10 22:14             ` Dmitry Gutov
2020-06-10 23:10               ` Juri Linkov
2020-06-10 23:24                 ` Dmitry Gutov
2020-06-13  9:51                 ` Simon Lang
2020-06-13 22:50                   ` Juri Linkov
2020-06-13  6:50           ` Eli Zaretskii
2020-06-13  9:48             ` Simon Lang
2020-09-27 12:56               ` Lars Ingebrigtsen
2020-06-09 12:15     ` Dmitry Gutov
2020-06-09 12:41       ` Simon Lang
2020-06-09 14:24 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8pl9rfn.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=41766@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --cc=dgutov@yandex.ru \
    --cc=simon.lang@outlook.com \
    --cc=simon.lang@yellowfrog.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.