From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: problem with recent change to grep-regexp-alist Date: Mon, 08 Aug 2005 23:38:04 +0300 Organization: JURTA Message-ID: <874qa05fmd.fsf@jurta.org> References: <20050806103401.GA369@dd213-213-54-232.pa1.infinito.it> <87r7d7j5pb.fsf@jurta.org> <85ek96lvn5.fsf@lola.goethe.zz> <742051605080707254aeaf65c@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1123535126 12749 80.91.229.2 (8 Aug 2005 21:05:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Aug 2005 21:05:26 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 08 23:05:16 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E2EnV-0000iQ-DC for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2005 23:04:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2EqW-0007nv-SP for ged-emacs-devel@m.gmane.org; Mon, 08 Aug 2005 17:07:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E2Eo6-0006Ru-Dw for emacs-devel@gnu.org; Mon, 08 Aug 2005 17:05:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E2Eo3-0006NZ-3b for emacs-devel@gnu.org; Mon, 08 Aug 2005 17:05:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2Enx-0006L9-UZ for emacs-devel@gnu.org; Mon, 08 Aug 2005 17:05:06 -0400 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E2Ev1-0004XP-AW; Mon, 08 Aug 2005 17:12:23 -0400 Original-Received: from mail.neti.ee (80-235-42-27-dsl.mus.estpak.ee [80.235.42.27]) by Relayhost2.neti.ee (Postfix) with ESMTP id 98B1716B8; Mon, 8 Aug 2005 23:58:02 +0300 (EEST) Original-To: Emanuele Giaquinta In-Reply-To: <742051605080707254aeaf65c@mail.gmail.com> (Emanuele Giaquinta's message of "Sun, 7 Aug 2005 16:25:00 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:41727 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41727 >> > Ok, let's use "\(.+?\)". >> > >> > You can still get wrong matches with the file names like "abc:123", >> > but perhaps such file names are rare. >> >> Maybe \([A-Za-z]:\| ... >> or something? It is not like there are many Unix file names starting >> with a single letter followed by colon. >> >> But Linux has file names like >> >> /proc/driver/uhci/0000:00:07.2 > > For those files the matching will be fine. It can't be fine, because the grep output is ambiguous. For example, for the grep output line: 1:2:3:4:text there are three different interpretations: file name `1:2:3', line number `4', source line `text' file name `1:2', line number `3', source line `4:text' file name `1', line number `2', source line `3:4:text' One way to resolve them is to match markup escape sequences that new GNU grep puts around file names and line numbers. You can see them in grep.txt under the title `GNU grep 2.5.1-cvs with default colors'. > The wrong matches occur when the filename contains somewhere the > pattern ":[0-9]+:" or ends with the pattern ":[0-9]+" (like Juri's example) > Juri, wouldn't be good to add a comment about this in grep.el or grep.txt? Since Richard doesn't want to document even `-n' option in grep.el, I am not sure I can add a comment in grep.el about such rare cases with numbers and colons in the file name. -- Juri Linkov http://www.jurta.org/emacs/