From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: S Boucher Newsgroups: gmane.emacs.bugs Subject: bug#6114: 23.1; grep-read-files does incorrect wildcard match Date: Fri, 21 May 2010 09:20:15 -0700 (PDT) Message-ID: <616488.63971.qm@web56807.mail.re3.yahoo.com> References: <741057.58002.qm@web56807.mail.re3.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1274461366 6425 80.91.229.12 (21 May 2010 17:02:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 21 May 2010 17:02:46 +0000 (UTC) Cc: 6114@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 21 19:02:43 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OFVcR-0001Xq-4M for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 May 2010 19:02:43 +0200 Original-Received: from localhost ([127.0.0.1]:52428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFVcQ-00075x-B0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 May 2010 13:02:42 -0400 Original-Received: from [140.186.70.92] (port=58633 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFVWz-00039q-Ed for bug-gnu-emacs@gnu.org; Fri, 21 May 2010 12:57:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFVWx-0000xg-Ke for bug-gnu-emacs@gnu.org; Fri, 21 May 2010 12:57:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35864) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFVWx-0000xc-J9 for bug-gnu-emacs@gnu.org; Fri, 21 May 2010 12:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OFV8k-0002qB-1u; Fri, 21 May 2010 12:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: S Boucher Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 May 2010 16:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6114 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6114-submit@debbugs.gnu.org id=B6114.127445948210911 (code B ref 6114); Fri, 21 May 2010 16:32:01 +0000 Original-Received: (at 6114) by debbugs.gnu.org; 21 May 2010 16:31:22 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFV85-0002pw-Co for submit@debbugs.gnu.org; Fri, 21 May 2010 12:31:22 -0400 Original-Received: from web56807.mail.re3.yahoo.com ([66.196.97.81]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OFUxQ-0002kJ-H8 for 6114@debbugs.gnu.org; Fri, 21 May 2010 12:20:21 -0400 Original-Received: (qmail 64778 invoked by uid 60001); 21 May 2010 16:20:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1274458815; bh=si3/NctF7Hox6v/eV9nPTAN1bAA4UA0NQL6dRYWrWSY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=OztvJFekOHzwimv9soYSqym0NZRcr6T3Pa54YVXKKdpuF4q2gcVIOqKpeG6Fsqul3Ya42GVZpHvxFlmxHK/MqasOcFxo9q6sI1ePYzAUVPZitaiXvkFAfWx7H1qse6Kmg3lN6bXSd7J0W7eAangchpUoaA8qG5P6kGVPlHLN/Fw= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Yr6Y4ZNKqZxtMdftjUd9kwbU4W9LszHs12M5mP4YIXsY1kY+2q++JTrAGZ2JelX5E8xI0o3zG1wln3FZgVaVyMOcea3eimmDzmOb3+EU9HeOeXzobJZuvA7Fv8vZZ1EyaKIo1WvK7p970a09iz2qAUCVQR/MzT2zz8CokrzZLco=; X-YMail-OSG: jndrEHIVM1lUFYPcaGYZmZzTLtq8FI583Y7REuV1yzxLWT0 1b8nlITamQ1TIESg.X_e4QH3dhVAIoznd1iR_gvkTVXCl14lRgTTcZUYhXXx o.pHAXPBmnwSUewPHyyWmtQze6xjEEBU3HLyebqnE_CjFJwOmtXB46vT.AEi hpv23z0CeyvhkVxSqx.4Vk3y24ZGAoBoB3ZHOFrlnCqOdM7oSpT13.G.WrZZ wKq99KBaveefqgGfpKtp8WlZKiwXqSDAIvx3a0ypDH2l2btCrFU5E7Q8cMhl .oucA9Qv3FamP3V0aRGYK1p6P79kjgB_VWfguMxzk05QDxOyySyo6SlhRzw- - Original-Received: from [209.5.112.166] by web56807.mail.re3.yahoo.com via HTTP; Fri, 21 May 2010 09:20:15 PDT X-Mailer: YahooMailClassic/11.0.8 YahooMailWebService/0.8.103.269680 In-Reply-To: <87pr0qxev1.fsf@mail.jurta.org> X-Mailman-Approved-At: Fri, 21 May 2010 12:31:21 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 21 May 2010 12:32:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37148 Archived-At: Tried it. Seems to work.=0A=0AThanks,=0A=0A--- On Thu, 5/20/10, Juri Linko= v wrote:=0A=0A> From: Juri Linkov =0A> Sub= ject: Re: 23.1; grep-read-files does incorrect wildcard match=0A> To: "S Bo= ucher" =0A> Cc: 6114@debbugs.gnu.org=0A> Received: Thursda= y, May 20, 2010, 8:28 PM=0A> > This bug is for (defun=0A> grep-read-files (= regexp) in file grep.el.=0A> >=0A> > In grep-read-files, there's a call to= =0A> (wildcard-to-regexp (cdr alias))=0A> > with the assumption that (cdr a= lias) is a single=0A> pattern.=A0 However,=0A> > the variable grep-files-al= iases actually can have=0A> multiple patterns=0A> > for each alias.=A0 So, = the multi-pattern aliases,=0A> such as for "cc",=0A> > cannot correctly mat= ch:=0A> >=0A> > (defcustom grep-files-aliases=0A> >=A0=A0=A0'(("asm" .=A0 = =A0 "*.[sS]")=0A> >=A0 =A0=A0=A0("c" .=A0=0A> =A0=A0=A0"*.c")=0A> >=A0 =A0= =A0=A0("cc" .=A0 =A0 "*.cc=0A> *.cxx *.cpp *.C *.CC *.c++")=0A> >=A0 =A0=A0= =A0... etc...=0A> =0A> Does this patch do what you want?=A0 (Please note th= at=0A> we have to remove=0A> "*" ("all") because it matches everything.)=0A= > =0A> =3D=3D=3D modified file 'lisp/progmodes/grep.el'=0A> --- lisp/progmo= des/grep.el=A0=A0=A0 2010-04-20=0A> 00:49:46 +0000=0A> +++ lisp/progmodes/g= rep.el=A0=A0=A0 2010-05-21=0A> 00:27:18 +0000=0A> @@ -781,12 +781,17 @@ (de= fun grep-read-files (regexp)=0A> =A0=A0=A0 =A0=A0=A0 =A0=0A> (file-name-no= ndirectory bn)))=0A> =A0=A0=A0=A0=A0(default-alias=0A> =A0=A0=A0 =A0=A0= =A0(and fn=0A> -=A0=A0=A0 =A0=A0=A0 (let ((aliases=0A> grep-files-aliases)= =0A> +=A0=A0=A0 =A0=A0=A0 (let ((aliases=0A> (remove (assoc "all" grep-file= s-aliases)=0A> +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=0A> =A0=A0=A0 =A0 =A0=0A> =A0= =A0=A0grep-files-aliases))=0A> =A0=A0=A0 =A0=A0=A0 =A0 =A0 =A0=0A> alias)= =0A> =A0=A0=A0 =A0=A0=A0 =A0 (while=0A> aliases=0A> =A0=A0=A0 =A0=A0=A0 = =A0 =A0 (setq=0A> alias (car aliases)=0A> =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=0A= > =A0 aliases (cdr aliases))=0A> -=A0=A0=A0 =A0=A0=A0 =A0 =A0 (if=0A> (stri= ng-match (wildcard-to-regexp (cdr alias)) fn)=0A> +=A0=A0=A0 =A0=A0=A0 =A0 = =A0 (if=0A> (string-match (mapconcat=0A> +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=0A>= =A0=A0=A0 =A0 =A0=0A> =A0=A0=A0'wildcard-to-regexp=0A> +=A0=A0=A0 =A0=A0= =A0 =A0=A0=A0=0A> =A0=A0=A0 =A0 =A0=0A> =A0=A0=A0(split-string (cdr alias) = nil t)=0A> +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=0A> =A0=A0=A0 =A0 =A0 =A0=A0=A0"\= \|")=0A> +=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=0A> =A0=A0=A0 =A0 =A0 =A0 fn)=0A> = =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=0A> (setq aliases nil)=0A> =A0=A0=A0 =A0=A0= =A0 =A0 =A0 =A0=0A> (setq alias nil)))=0A> =A0=A0=A0 =A0=A0=A0 =A0 (cdr=0A= > alias))))=0A> =0A> -- =0A> Juri Linkov=0A> http://www.jurta.org/emacs/=0A= > =0A=0A