From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: problem with recent change to grep-regexp-alist Date: Tue, 09 Aug 2005 19:57:17 -0400 Message-ID: References: <20050806103401.GA369@dd213-213-54-232.pa1.infinito.it> <87r7d7j5pb.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1123632262 22158 80.91.229.2 (10 Aug 2005 00:04:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Aug 2005 00:04:22 +0000 (UTC) Cc: Emanuele Giaquinta , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 10 02:04:19 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E2e3i-0000Ox-BH for ged-emacs-devel@m.gmane.org; Wed, 10 Aug 2005 02:03:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2e2s-0000eu-4F for ged-emacs-devel@m.gmane.org; Tue, 09 Aug 2005 20:02:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E2e2K-0000bp-DY for emacs-devel@gnu.org; Tue, 09 Aug 2005 20:01:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E2e2I-0000at-FE for emacs-devel@gnu.org; Tue, 09 Aug 2005 20:01:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2e2I-0000aV-2t for emacs-devel@gnu.org; Tue, 09 Aug 2005 20:01:34 -0400 Original-Received: from [195.186.19.62] (helo=mail14.bluewin.ch) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E2eCB-0007Kr-N8 for emacs-devel@gnu.org; Tue, 09 Aug 2005 20:11:47 -0400 Original-Received: from empanada.local (83.76.14.40) by mail14.bluewin.ch (Bluewin 7.2.063) id 42D27FC00046B700; Tue, 9 Aug 2005 23:57:14 +0000 Original-Received: by empanada.local (Postfix, from userid 502) id C6D275FFB98; Tue, 9 Aug 2005 19:57:17 -0400 (EDT) Original-To: Juri Linkov In-Reply-To: <87r7d7j5pb.fsf@jurta.org> (Juri Linkov's message of "Sat, 06 Aug 2005 21:11:44 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41826 >> 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