From: npostavs@users.sourceforge.net
To: bug#6843 <6843@debbugs.gnu.org>,
Andreas Schwab <schwab@linux-m68k.org>,
Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#6843: grep-mode and filenames with colons
Date: Wed, 26 Jul 2017 19:32:27 -0400 [thread overview]
Message-ID: <87h8xy93lg.fsf@users.sourceforge.net> (raw)
In-Reply-To: bug's message of "Wed\, 26 Jul 2017 22\:31\:22 +0000"
On Wed, Jul 26, 2017 at 12:58 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:
>
>> +*** Grep commands will now use GNU grep's '--null' option if
>> +available, which allows distinguishing the filename from contents if
>> +they contain colons. This can be controlled by the new custom option
>> +'grep-use-null-filename-separator'.
>
>
> Why do the want the option?
>
> And on the same note, are there any versions of Grep in widespread usage
> that don't support '--null'? AFAICT this flag was added to GNU Grep 2.4
> which was released in 1999.
As noted in the emacs-devel thread, non-GNU greps don't support it.
>> +(defconst grep--regexp-alist-bin-matcher
>> + '("^Binary file \\(.+\\) matches$" 1 nil nil 0 1))
>> +(defconst grep-with-null-regexp-alist
>> + `(("^\\([^\0]+\\)\\(\0\\)\\([0-9]+\\):" 1 3 ,grep--regexp-alist-column
>> nil nil
>
>
> Any reason to change 2 to 3? Why don't we use a non-capturing group for \0
> here?
It's on the next line, I capture the \0 so as to display it with a nicer
string than "^@".
>> + (2 '(face unspecified display ":")))
> If the numbers are the same, we could keep the variable's name the same as
> well. As a result, most third-party code would continue to simply work.
Might be worth using explicitly numbered groups to keep the numbers for
FILE and COLUMN the same though.
>> + ,grep--regexp-alist-bin-matcher)
>> + "Regexp used to match grep hits.
>> +See `compilation-error-regexp-alist'.")
>> +(defconst grep-fallback-regexp-alist
>
>
> Compensating for the multitude of variables by eliminating newlines between
> them doesn't look too hot to me.
Hmm yeah, I think I had them originally as let-bindings, and then I
forgot to space them out when converting to defconst.
next prev parent reply other threads:[~2017-07-26 23:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-11 11:20 bug#6843: 23.1; grep-mode and filenames with colors Ethan Glasser-Camp
2017-07-26 23:32 ` npostavs [this message]
2017-07-27 12:10 ` bug#6843: grep-mode and filenames with colons Dmitry Gutov
2017-07-27 17:20 ` Eli Zaretskii
2017-07-30 15:01 ` npostavs
2017-08-01 13:28 ` Dmitry Gutov
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=87h8xy93lg.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=6843@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=schwab@linux-m68k.org \
/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.