all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: grep.el regexp
Date: Sat, 09 Jul 2005 23:56:16 +0300	[thread overview]
Message-ID: <87y88fwpu7.fsf@jurta.org> (raw)
In-Reply-To: <E1Dr6ps-0007bA-Lk@fencepost.gnu.org> (Richard M. Stallman's message of "Sat, 09 Jul 2005 00:21:04 -0400")

[-- Attachment #1: Type: text/plain, Size: 1267 bytes --]

> [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'.


[-- Attachment #2: grep.txt --]
[-- Type: text/plain, Size: 1716 bytes --]

* 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 matchers
you need and as a test of the matchers.  Move the mouse over a colored part 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=always -e "xyzxyz" *
emacs-2:1205:inserts `^[[01;31mxyzxyz^[[00m^[[01;31mxyzxyz^[[00m' in the current buffer.

* GNU grep 2.5.1-cvs

grep -nH --color=always -e "xyzxyz" *
^[[35m^[[Kemacs-2^[[m^[[K^[[36m^[[K:^[[m^[[K^[[32m^[[K1205^[[m^[[K^[[36m^[[K:^[[m^[[Kinserts `^[[01;31m^[[Kxyzxyz^[[m^[[K^[[01;31m^[[Kxyzxyz^[[m^[[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.

[-- Attachment #3: Type: text/plain, Size: 45 bytes --]


-- 
Juri Linkov
http://www.jurta.org/emacs/

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2005-07-09 20:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1Djqpn-0003ih-62@fencepost.gnu.org>
     [not found] ` <87psuipj8b.fsf@jurta.org>
2005-06-20  3:50   ` grep.el regexp Richard Stallman
2005-06-22 16:27     ` Juri Linkov
2005-06-23 16:53       ` Richard M. Stallman
2005-06-27 23:57         ` Juri Linkov
2005-06-28  6:19           ` Stefan Monnier
2005-06-28 21:29             ` Richard M. Stallman
2005-06-29  3:52               ` Stefan Monnier
2005-06-29 20:43                 ` Richard M. Stallman
2005-06-30 17:34                   ` Stefan Monnier
2005-07-01  4:03                     ` Richard M. Stallman
2005-07-09  4:21                     ` Richard M. Stallman
2005-07-09 20:56                       ` Juri Linkov [this message]
2005-07-10 17:35                         ` Richard M. Stallman
2005-07-11  0:04                           ` Juri Linkov
2005-07-11 16:53                             ` Richard M. Stallman
2005-07-19 15:55                               ` Juri Linkov
2005-07-22  4:56                                 ` Richard M. Stallman
2005-07-22 18:09                                   ` Juri Linkov
2005-07-23 14:02                                     ` Richard M. Stallman
2005-07-19 15:59                               ` Juri Linkov
2005-07-24  0:01                                 ` Richard M. Stallman
2005-08-04  2:14                                   ` Juri Linkov
2005-08-04 20:45                                     ` Richard M. Stallman
2005-08-05  0:05                                       ` Juri Linkov
2005-08-05 20:37                                         ` Richard M. Stallman
2005-07-12  6:55                           ` Juri Linkov
2005-07-13  5:17                             ` Richard M. Stallman
2005-06-28 18:47           ` Richard M. Stallman

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=87y88fwpu7.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.