[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changes to emacs/lisp/progmodes/grep.el

From: Daniel Pfeiffer
Subject: Re: Changes to emacs/lisp/progmodes/grep.el
Date: Sun, 27 Jun 2004 12:33:40 +0200

Saluton, Moin,

Richard Stallman <address@hidden> skribis:

> Would you please say precisely what job this Perl script does,
> and what purpose people would use it for?  Those details are
> not clear to me, so I don't understand what question we are
> discussing.

I've written a little Perl script, which is not production quality yet.  This
serves two purposes I'm frequently confronted with:

- easily deployable on machines without GNU grep
- can match over several lines.

=head1 NAME

plgrep -- Perl grep specially useful within Emacs


 plgrep -n3 'regexp spanning\n upto\n 3 lines' file ...
 plgrep -R -c 'regexp looked for in C sources in and recursively under dir'
dir ...
 plgrep --eval 'script "perl"' 'regexp looked for only in all perl scripts in
 plgrep --eval 'script "perl"; $_ = 0 if /^=/../^=cut/ or /^\s*#/' 'same,
excluding POD or comment lines'

Unlike other greps, this prints out only the name of the file.  Instead of
prepending the directory on every line, it outputs "Entering directory"
messages as necessary.  It also outputs column numbers.  Emacs M-x grep picks
up this information.

The regexps are in Perl syntax, giving you very rich possibilities.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

lerne / learn / apprends / lär dig / ucz się    Esperanto:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]