unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>, emacs-devel@gnu.org
Subject: Re: problem with recent change to grep-regexp-alist
Date: Tue, 09 Aug 2005 19:57:17 -0400	[thread overview]
Message-ID: <m1zmrq8y3b.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87r7d7j5pb.fsf@jurta.org> (Juri Linkov's message of "Sat, 06 Aug 2005 21:11:44 +0300")

>> In the 1.42 revision of grep.el the subpattern for the filename in the
>> regexps of the first two grep-regexp-alist's elements has been changed
>> from "\(.+?\)" to "\([^:\n]+\)". Now the matching fails if the
>> filename contains a colon, while the previous value worked, thanks to the
>> non greedy "+?" quantifier. Note that the regexp of the third
>> grep-regexp-alist's element is still correct, and is the one that
>> matches if grep-highlight-matches's value is "t" (which is the
>> default).

> Ok, let's use "\(.+?\)".

> You can still get wrong matches with the file names like "abc:123",
> but perhaps such file names are rare.

It doesn't matter whether they're rare or not: they result in ambiguous
output from grep, so in such cases Emacs can't be sure to get it right.
I.e. the .+? regexp is as good as it gets: when it's not ambiguous it works
right, and when it's ambiguous it chooses one of the possibilities
"arbitrarily".


        Stefan

      parent reply	other threads:[~2005-08-09 23:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-06 10:34 problem with recent change to grep-regexp-alist Emanuele Giaquinta
2005-08-06 18:11 ` Juri Linkov
2005-08-06 19:20   ` David Kastrup
2005-08-07 14:25     ` Emanuele Giaquinta
2005-08-08 20:38       ` Juri Linkov
2005-08-08 22:56         ` Emanuele Giaquinta
2005-08-10  4:02           ` Juri Linkov
2005-08-09 23:57   ` Stefan Monnier [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m1zmrq8y3b.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=emanuele.giaquinta@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).