From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: dapfy@t-online.de (Daniel Pfeiffer) Newsgroups: gmane.emacs.devel Subject: Re: Changes to emacs/lisp/progmodes/grep.el Date: Sun, 27 Jun 2004 12:33:40 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040627123340.5d3354cd@pfdabpc.inhouse.start.de> References: <87isdgnzzi.fsf@mail.jurta.org> <20040625220304.0f1fd05a@pfdabpc.inhouse.start.de> Reply-To: Daniel Pfeiffer NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1088332344 16464 80.91.224.253 (27 Jun 2004 10:32:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 27 Jun 2004 10:32:24 +0000 (UTC) Cc: juri@jurta.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Jun 27 12:32:16 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BeWxM-0003UN-00 for ; Sun, 27 Jun 2004 12:32:16 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BeWxL-0005i6-00 for ; Sun, 27 Jun 2004 12:32:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BeWyu-0004eW-5Z for emacs-devel@quimby.gnus.org; Sun, 27 Jun 2004 06:33:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BeWyn-0004eN-0e for emacs-devel@gnu.org; Sun, 27 Jun 2004 06:33:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BeWym-0004eB-59 for emacs-devel@gnu.org; Sun, 27 Jun 2004 06:33:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BeWym-0004e8-0d for emacs-devel@gnu.org; Sun, 27 Jun 2004 06:33:44 -0400 Original-Received: from [194.25.134.21] (helo=mailout10.sul.t-online.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BeWx5-00045Z-Vo; Sun, 27 Jun 2004 06:32:00 -0400 Original-Received: from fwd06.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1BeWx3-0001Id-0C; Sun, 27 Jun 2004 12:31:57 +0200 Original-Received: from pfdabpc.inhouse.start.de (G-6SF8ZcYelqzdanpSHEJ1wIH6tT9EzxG8I3rkS9pvxNJZbTQ0ctYG@[217.234.41.145]) by fwd06.sul.t-online.com with smtp id 1BeWwz-24CMfQ0; Sun, 27 Jun 2004 12:31:53 +0200 Original-To: rms@gnu.org In-Reply-To: X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) X-Seen: false X-ID: G-6SF8ZcYelqzdanpSHEJ1wIH6tT9EzxG8I3rkS9pvxNJZbTQ0ctYG X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:25272 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25272 Saluton, Moin, Richard Stallman 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 =head1 SYNOPSIS 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 pwd' 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: http://lernu.net/