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: grep.el regexp Date: Sat, 09 Jul 2005 23:56:16 +0300 Organization: JURTA Message-ID: <87y88fwpu7.fsf@jurta.org> References: <87psuipj8b.fsf@jurta.org> <87k6kme6sp.fsf@jurta.org> <87aclb2w0m.fsf@jurta.org> <873br3xaum.fsf-monnier+emacs@gnu.org> <87u0jh6cwq.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1120956837 3393 80.91.229.2 (10 Jul 2005 00:53:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Jul 2005 00:53:57 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 10 02:53:56 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DrQ4n-0006fw-B4 for ged-emacs-devel@m.gmane.org; Sun, 10 Jul 2005 02:53:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DrQ6H-0005Vg-Nt for ged-emacs-devel@m.gmane.org; Sat, 09 Jul 2005 20:55:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DrQ4v-0005D2-CG for emacs-devel@gnu.org; Sat, 09 Jul 2005 20:53:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DrQ4p-0005AO-Em for emacs-devel@gnu.org; Sat, 09 Jul 2005 20:53:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DrQ4o-00053F-0q for emacs-devel@gnu.org; Sat, 09 Jul 2005 20:53:46 -0400 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DrPuZ-0005GC-Iv; Sat, 09 Jul 2005 20:43:11 -0400 Original-Received: from mail.neti.ee (80-235-34-69-dsl.mus.estpak.ee [80.235.34.69]) by Relayhost1.neti.ee (Postfix) with ESMTP id CE59A1F81; Sun, 10 Jul 2005 03:35:55 +0300 (EEST) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Sat, 09 Jul 2005 00:21:04 -0400") 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:40701 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40701 --=-=-= > [I sent this message a few weeks ago but did not get a response. > Could we get the discussion moving again?] > > > I am not sure whether that relates to the suggestion I made: > > >> I think that if we wrote a separate regexp for each kind of grep, > >> all together they would match a lot fewer different strings than the > >> current regexp does, and they would be much easier to understand. > > Indeed, the two do not conflict. I.e. I think there's no problem with > compile.el's current behavior in this regard and I believe your suggestion > w.r.t grep.el should work just fine. > > Would someone like to try implementing this? > (Please respond to this message, if so.) Perhaps what is needed to start with is to ask people to send output examples of different kinds of grep. We could put these example in a new file etc/grep.txt similarly to etc/compilation.txt. I've collected a few examples in the file attached below. The section `grep ???' contains examples deduced from regexps in `grep-regexp-alist'. Could someone recognize what grep produces them? Also you can see that with recent changes in GNU grep CVS it produces escape sequences not handled by grep.el. This requires a separate rule in `grep-regexp-alist'. --=-=-= Content-Disposition: inline; filename=grep.txt Content-Transfer-Encoding: quoted-printable * Introduction -*-grep-*- This shows the different kinds of messages grep recognizes by default and how they are rendered. It is intended both to help you decide which matc= hers you need and as a test of the matchers. Move the mouse over a colored pa= rt or use `compilation-message-face', to see how much text was actually matched= . * GNU grep 2.5.1 grep -nH -e "xyzxyz" * emacs-2:1205:inserts `xyzxyzxyzxyz' in the current buffer. * GNU grep 2.5.1 without line numbers grep -e "xyzxyz" * emacs-2:inserts `xyzxyzxyzxyz' in the current buffer. * GNU grep 2.5.1 with color matches grep -nH --color=3Dalways -e "xyzxyz" * emacs-2:1205:inserts `=1B[01;31mxyzxyz=1B[00m=1B[01;31mxyzxyz=1B[00m' in = the current buffer. * GNU grep 2.5.1-cvs grep -nH --color=3Dalways -e "xyzxyz" * =1B[35m=1B[Kemacs-2=1B[m=1B[K=1B[36m=1B[K:=1B[m=1B[K=1B[32m=1B[K1205=1B[m= =1B[K=1B[36m=1B[K:=1B[m=1B[Kinserts `=1B[01;31m=1B[Kxyzxyz=1B[m=1B[K=1B[0= 1;31m=1B[Kxyzxyz=1B[m=1B[K' in the current buffer. * agrep agrep -n "xyzxyz" * emacs-2: 1205: inserts `xyzxyzxyzxyz' in the current buffer. * sgrep sgrep -l '"xyzxyz"' * ------------- #1 emacs-2: 6 (6641933,6641938 : 50542,50547) xyzxyz ------------- #2 emacs-2: 6 (6641936,6641941 : 50545,50550) xyzxyz ------------- #3 emacs-2: 6 (6641939,6641944 : 50548,50553) xyzxyz * grep ??? grep -nH -e "xyzxyz" * emacs-2:1205:9:inserts `xyzxyzxyzxyz' in the current buffer. emacs-2:1205:9-15:inserts `xyzxyzxyzxyz' in the current buffer. emacs-2:1205.9-1205.9:inserts `xyzxyzxyzxyz' in the current buffer. emacs-2 1205.9-15 inserts `xyzxyzxyzxyz' in the current buffer. emacs-2 1205.9-1205.9 inserts `xyzxyzxyzxyz' in the current buffer. emacs-2 1205 inserts `xyzxyzxyzxyz' in the current buffer. --=-=-= -- Juri Linkov http://www.jurta.org/emacs/ --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--