From jidanni@jidanni.org Thu Nov 19 17:42:57 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Nov 2009 01:42:57 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.7 required=4.0 tests=AWL,MONOTONE_WORDS_2_15, SARE_RECV_SPAM_DOMN0b autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAK1gtg6005317 for ; Thu, 19 Nov 2009 17:42:57 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBIWV-0002Oy-Gy for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 20:42:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBIWR-0002Kc-Lv for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 20:42:55 -0500 Received: from [199.232.76.173] (port=40786 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBIWR-0002KE-AV for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 20:42:51 -0500 Received: from caiajhbdcbef.dreamhost.com ([208.97.132.145]:43810 helo=homiemail-a38.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBIWQ-0005Qa-WC for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 20:42:51 -0500 Received: from jidanni.org (218-163-1-73.dynamic.hinet.net [218.163.1.73]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by homiemail-a38.g.dreamhost.com (Postfix) with ESMTP id 6F4F3D4866 for ; Thu, 19 Nov 2009 17:42:48 -0800 (PST) From: jidanni@jidanni.org To: bug-gnu-emacs@gnu.org Subject: rgrep can't deal with .gz files Date: Fri, 20 Nov 2009 09:42:45 +0800 Message-ID: <87ocmyx97u.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) rgrep should be enhanced so if it encounters .gz files it knows what to do. From juri@jurta.org Fri Nov 20 01:38:32 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 20 Nov 2009 09:38:32 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.starman.ee (smtp-out3.starman.ee [85.253.0.5]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAK9cVKU020084 for <4982@emacsbugs.donarmstrong.com>; Fri, 20 Nov 2009 01:38:32 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.34.117.cable.starman.ee [82.131.34.117]) by mx1.starman.ee (Postfix) with ESMTP id 92CD53F4091; Fri, 20 Nov 2009 11:38:24 +0200 (EET) From: Juri Linkov To: jidanni@jidanni.org Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files Organization: JURTA References: <87ocmyx97u.fsf@jidanni.org> Date: Fri, 20 Nov 2009 11:31:39 +0200 In-Reply-To: <87ocmyx97u.fsf@jidanni.org> (jidanni@jidanni.org's message of "Fri, 20 Nov 2009 09:42:45 +0800") Message-ID: <87ocmxadd8.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > rgrep should be enhanced so if it encounters .gz files > it knows what to do. This would be tricky to implement. When searching in .gz files we have to rely on zgrep (that has its own problems - it doesn't highlight grep matches). I suggest creating a new command (say, `zrgrep') as a wrapper for `zgrep' and with UI like `rgrep'. -- Juri Linkov http://www.jurta.org/emacs/ From geb-bug-gnu-emacs@m.gmane.org Fri Nov 20 02:13:43 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Nov 2009 10:13:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAKADeeU023902 for ; Fri, 20 Nov 2009 02:13:42 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBQUk-0001IQ-J3 for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:13:38 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBQUe-0001GA-CJ for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:13:36 -0500 Received: from [199.232.76.173] (port=49999 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBQUe-0001G5-5f for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:13:32 -0500 Received: from lo.gmane.org ([80.91.229.12]:60637) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBQUd-000317-AB for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:13:31 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NBQUY-0001Vt-GD for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 11:13:26 +0100 Received: from 23.77.197-77.rev.gaoland.net ([77.197.77.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Nov 2009 11:13:26 +0100 Received: from thierry.volpiatto by 23.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Nov 2009 11:13:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Thierry Volpiatto Subject: Re: bug#4982: rgrep can't deal with .gz files Date: Fri, 20 Nov 2009 11:07:08 +0100 Organization: ThierryVolpiatto Lines: 22 Message-ID: <87vdh5ik6r.fsf@tux.homenetwork> References: <87ocmyx97u.fsf@jidanni.org> <87ocmxadd8.fsf@mail.jurta.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 23.77.197-77.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUHBARgJRFPS0WbMBTC TSG/uJs0yyVHAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABpUlE QVQ4y3VTQXKDMAyUnD7AwvQOhtxj5N4LFh9ow/+/UtlpM0BczWSS0Wola7UBeEb3+3kJ/5p9ZLz3 UI0n0J0Y4K/lh1nG24FhlJOR2LdSKtpV5gfi/Zd+NdaJBbB4D5N0JnfUIVp6obZURkJwS2a8b9uX AkgxA5gCEcknAH1s2z0DPooWmjGKcJR+HNZt+9bm0GtGRycRuZGs98Ffr02vABWGopIAhmXmxnQN BwBXZjgFLHRoqbfeYxCLWqsjLyKhbEHW+A5nEs699Q2O80ALrgHTmUTy6P0MnKyKQpKHpoNWokxs F0D5VegvWmEozyE6nuMiS98mWzlUQ9bW8qYfqOaFtzWlYCqGeIs6HEyl08jkrxUG9MF5ipXpOOpd ZMoXPPVSLWJiiwNNB+eRSyxJZmQKcacikgucnCRiHuJOLmyYJRDPwOqAvY4pA+Wy+VS8G26BAsdb Ph2Hw7ORy/H0IOG0TnaM8Cp0XrFYyU0v2z8AqkifPVbLZ0qo/gsRg60C7p+8Ov9jrUIxFde+jnAq X42hyp/c+ZcnVyUYBarrqZt3+R8450png3cWKgAAACV0RVh0Y3JlYXRlLWRhdGUAMjAwOC0wNS0z MVQyMjoxNDoyMiswMjowMM7uH/IAAAARdEVYdGpwZWc6Y29sb3JzcGFjZQAyLHVVnwAAACB0RVh0 anBlZzpzYW1wbGluZy1mYWN0b3IAMngyLDF4MSwxeDFJ+qa0AAAAJXRFWHRtb2RpZnktZGF0ZQAy MDA3LTEwLTI4VDE3OjA4OjQ4KzAxOjAwhqNSRgAAAABJRU5ErkJggg== Cancel-Lock: sha1:VLyjiR5KxO54Qw5700ot8ArvtOs= Sender: news X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Juri Linkov writes: >> rgrep should be enhanced so if it encounters .gz files >> it knows what to do. > > This would be tricky to implement. When searching in .gz files > we have to rely on zgrep (that has its own problems - it doesn't > highlight grep matches). traverselisp.el handle compressed archives using avfs. http://www.emacswiki.org/cgi-bin/emacs/traverselisp.el You can launch traverse-deep-rfind (similar to rgrep) on any archive.(tar)gz. You could use also avfs to handle .gz files with rgrep. http://sourceforge.net/projects/avf/ > I suggest creating a new command (say, `zrgrep') as a wrapper for `zgrep' > and with UI like `rgrep'. -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France From geb-bug-gnu-emacs@m.gmane.org Fri Nov 20 02:45:20 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Nov 2009 10:45:20 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAKAjIK1026972 for ; Fri, 20 Nov 2009 02:45:19 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBQzN-0007Dh-Tj for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:45:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBQzI-00074Q-Ev for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:45:16 -0500 Received: from [199.232.76.173] (port=38499 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBQzI-000744-6e for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:45:12 -0500 Received: from lo.gmane.org ([80.91.229.12]:45369) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBQzH-0000DY-Or for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 05:45:11 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NBQz9-0006Cx-6Q for bug-gnu-emacs@gnu.org; Fri, 20 Nov 2009 11:45:03 +0100 Received: from c-71-237-24-138.hsd1.co.comcast.net ([71.237.24.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Nov 2009 11:45:03 +0100 Received: from kevin.d.rodgers by c-71-237-24-138.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 Nov 2009 11:45:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-gnu-emacs@gnu.org From: Kevin Rodgers Subject: Re: bug#4982: rgrep can't deal with .gz files Date: Fri, 20 Nov 2009 03:43:40 -0700 Lines: 9 Message-ID: References: <87ocmyx97u.fsf@jidanni.org> <87ocmxadd8.fsf@mail.jurta.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-24-138.hsd1.co.comcast.net User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) In-Reply-To: <87ocmxadd8.fsf@mail.jurta.org> Sender: news X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Juri Linkov wrote: > I suggest creating a new command (say, `zrgrep') as a wrapper for `zgrep' > and with UI like `rgrep'. Clearly, it should be called `rzgrep' :-) -- Kevin Rodgers Denver, Colorado, USA From jidanni@jidanni.org Fri Nov 20 13:17:07 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 20 Nov 2009 21:17:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, SARE_RECV_SPAM_DOMN0b autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from homiemail-a4.g.dreamhost.com (caiajhbdcahe.dreamhost.com [208.97.132.74]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAKLH6pP025188 for <4982@emacsbugs.donarmstrong.com>; Fri, 20 Nov 2009 13:17:07 -0800 Received: from jidanni.org (218-163-2-8.dynamic.hinet.net [218.163.2.8]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by homiemail-a4.g.dreamhost.com (Postfix) with ESMTP id 723DE414F8; Fri, 20 Nov 2009 13:17:06 -0800 (PST) From: jidanni@jidanni.org To: juri@jurta.org Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files References: <87ocmxadd8.fsf@mail.jurta.org> Date: Sat, 21 Nov 2009 05:17:02 +0800 Message-ID: <87zl6gzyk1.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> "JL" == Juri Linkov writes: >> rgrep should be enhanced so if it encounters .gz files >> it knows what to do. JL> This would be tricky to implement. When searching in .gz files JL> we have to rely on zgrep Ah, of course... OK, now in .emacs I'll just use (setq grep-program "zgrep") as a workaround, as zgrep also works fine on non compressed files. JL>(that has its own problems - it doesn't highlight grep matches). Seems to work for me. JL> I suggest creating a new command (say, `zrgrep') as a wrapper for `zgrep' JL> and with UI like `rgrep'. From juri@jurta.org Sun Nov 22 02:39:42 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 22 Nov 2009 10:39:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.starman.ee (smtp-out4.starman.ee [85.253.0.6]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAMAdfLt009965 for <4982@emacsbugs.donarmstrong.com>; Sun, 22 Nov 2009 02:39:42 -0800 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Received: from mail.starman.ee (82.131.32.177.cable.starman.ee [82.131.32.177]) by mx2.starman.ee (Postfix) with ESMTP id 46DD23F40A9; Sun, 22 Nov 2009 12:39:33 +0200 (EET) From: Juri Linkov To: jidanni@jidanni.org Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files Organization: JURTA References: <87ocmxadd8.fsf@mail.jurta.org> <87zl6gzyk1.fsf@jidanni.org> Date: Sun, 22 Nov 2009 12:28:31 +0200 In-Reply-To: <87zl6gzyk1.fsf@jidanni.org> (jidanni@jidanni.org's message of "Sat, 21 Nov 2009 05:17:02 +0800") Message-ID: <877htj6k0g.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > JL>(that has its own problems - it doesn't highlight grep matches). > > Seems to work for me. Hmm, strange. In http://thread.gmane.org/gmane.emacs.bugs/16956 you requested us to remove highlighting when there are additional filters on the grep output. So we changed `--color=always' into `--color=auto' that broke the highlighting in zgrep output because zgrep uses additional filters. But now you say that highlighting in zgrep output works for you. I wonder how this is possible? -- Juri Linkov http://www.jurta.org/emacs/ From juri@jurta.org Sun Nov 22 02:39:43 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 22 Nov 2009 10:39:43 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.starman.ee (smtp-out4.starman.ee [85.253.0.6]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAMAdfv9009966 for <4982@emacsbugs.donarmstrong.com>; Sun, 22 Nov 2009 02:39:43 -0800 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Received: from mail.starman.ee (82.131.32.177.cable.starman.ee [82.131.32.177]) by mx2.starman.ee (Postfix) with ESMTP id D65A93F40AA; Sun, 22 Nov 2009 12:39:35 +0200 (EET) From: Juri Linkov To: Kevin Rodgers Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files Organization: JURTA References: <87ocmyx97u.fsf@jidanni.org> <87ocmxadd8.fsf@mail.jurta.org> Date: Sun, 22 Nov 2009 12:33:42 +0200 In-Reply-To: (Kevin Rodgers's message of "Fri, 20 Nov 2009 03:43:40 -0700") Message-ID: <87hbsn557d.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > > I suggest creating a new command (say, `zrgrep') as a wrapper for `zgrep' > > and with UI like `rgrep'. > > Clearly, it should be called `rzgrep' :-) See in the zgrep script: grep='${GREP-grep}' version='z$grep (gzip) 1.3.12' So according to the naming convention of zgrep, it prepends the "z" prefix to any grep command name :-) -- Juri Linkov http://www.jurta.org/emacs/ From jidanni@jidanni.org Sun Nov 22 17:53:39 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 23 Nov 2009 01:53:39 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.2 required=4.0 tests=AWL,FOURLA,FVGT_m_MULTI_ODD, HAS_BUG_NUMBER,SARE_RECV_SPAM_DOMN0b autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from homiemail-a6.g.dreamhost.com (caiajhbdcbhh.dreamhost.com [208.97.132.177]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAN1rc4s031012 for <4982@emacsbugs.donarmstrong.com>; Sun, 22 Nov 2009 17:53:39 -0800 Received: from jidanni.org (218-163-0-11.dynamic.hinet.net [218.163.0.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by homiemail-a6.g.dreamhost.com (Postfix) with ESMTP id BDCD414165; Sun, 22 Nov 2009 17:53:50 -0800 (PST) From: jidanni@jidanni.org To: juri@jurta.org Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files References: <877htj6k0g.fsf@mail.jurta.org> Date: Mon, 23 Nov 2009 09:53:33 +0800 Message-ID: <87ws1i6m76.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> "JL" == Juri Linkov writes: JL> But now you say that highlighting in zgrep output works for you. JL> I wonder how this is possible? All I know is after I changed grep-command to zgrep, when I run (rgrep "JL" "* .*" "~" nil) it uses find . \( -path \*/SCCS ... xargs -0 -e zgrep -nH -e JL and the front of this line is blue: ./KIDPIX/n_PICT4993.JPG:Binary file (standard input) matches and this is green: ./.ssh/known_hosts:14:|1|HHSxNOckqq Note for me $ env|grep -ci grep 0 and I use the latest debian emacs-snapshot. From monnier@iro.umontreal.ca Sun Nov 22 20:26:56 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 23 Nov 2009 04:26:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAN4Qtpn014936 for <4982@emacsbugs.donarmstrong.com>; Sun, 22 Nov 2009 20:26:56 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAB+eCUvO+IIa/2dsb2JhbACBTdFghDwEigI X-IronPort-AV: E=Sophos;i="4.47,269,1257138000"; d="scan'208";a="49826752" Received: from 206-248-130-26.dsl.teksavvy.com (HELO ceviche.home) ([206.248.130.26]) by ironport2-out.pppoe.ca with ESMTP; 22 Nov 2009 23:26:49 -0500 Received: by ceviche.home (Postfix, from userid 20848) id 7250BB40C9; Sun, 22 Nov 2009 23:26:49 -0500 (EST) From: Stefan Monnier To: Juri Linkov Cc: 4982@debbugs.gnu.org, jidanni@jidanni.org Subject: Re: bug#4982: rgrep can't deal with .gz files Message-ID: References: <87ocmxadd8.fsf@mail.jurta.org> <87zl6gzyk1.fsf@jidanni.org> <877htj6k0g.fsf@mail.jurta.org> Date: Sun, 22 Nov 2009 23:26:49 -0500 In-Reply-To: <877htj6k0g.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 22 Nov 2009 12:28:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Hmm, strange. In http://thread.gmane.org/gmane.emacs.bugs/16956 > you requested us to remove highlighting when there are additional > filters on the grep output. So we changed `--color=always' into > `--color=auto' that broke the highlighting in zgrep output because > zgrep uses additional filters. Maybe zgrep is careful to distinguish filters on the input from filters on the output. AFAICT zgrep only uses a filter on the input, so it should work. Stefan From juri@jurta.org Mon Nov 23 02:40:56 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 23 Nov 2009 10:40:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,FOURLA,FVGT_m_MULTI_ODD, HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.starman.ee (smtp-out3.starman.ee [85.253.0.5]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nANAerja019110 for <4982@emacsbugs.donarmstrong.com>; Mon, 23 Nov 2009 02:40:55 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.34.24.cable.starman.ee [82.131.34.24]) by mx1.starman.ee (Postfix) with ESMTP id 5E13B3F422B; Mon, 23 Nov 2009 12:40:46 +0200 (EET) From: Juri Linkov To: jidanni@jidanni.org Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files Organization: JURTA References: <877htj6k0g.fsf@mail.jurta.org> <87ws1i6m76.fsf@jidanni.org> Date: Mon, 23 Nov 2009 11:58:32 +0200 In-Reply-To: <87ws1i6m76.fsf@jidanni.org> (jidanni@jidanni.org's message of "Mon, 23 Nov 2009 09:53:33 +0800") Message-ID: <876391imuv.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > JL> But now you say that highlighting in zgrep output works for you. > JL> I wonder how this is possible? > > All I know is after I changed grep-command to zgrep, when I run > (rgrep "JL" "* .*" "~" nil) > it uses > find . \( -path \*/SCCS ... xargs -0 -e zgrep -nH -e JL > and the front of this line is blue: > ./KIDPIX/n_PICT4993.JPG:Binary file (standard input) matches > and this is green: > ./.ssh/known_hosts:14:|1|HHSxNOckqq So you don't see yellow matches? -- Juri Linkov http://www.jurta.org/emacs/ From juri@jurta.org Mon Nov 23 02:40:58 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 23 Nov 2009 10:40:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.starman.ee (smtp-out3.starman.ee [85.253.0.5]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nANAeuEL019115 for <4982@emacsbugs.donarmstrong.com>; Mon, 23 Nov 2009 02:40:57 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.34.24.cable.starman.ee [82.131.34.24]) by mx1.starman.ee (Postfix) with ESMTP id F3B383F4219; Mon, 23 Nov 2009 12:40:46 +0200 (EET) From: Juri Linkov To: Stefan Monnier Cc: 4982@debbugs.gnu.org, jidanni@jidanni.org Subject: Re: bug#4982: rgrep can't deal with .gz files Organization: JURTA References: <87ocmxadd8.fsf@mail.jurta.org> <87zl6gzyk1.fsf@jidanni.org> <877htj6k0g.fsf@mail.jurta.org> Date: Mon, 23 Nov 2009 11:57:43 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 22 Nov 2009 23:26:49 -0500") Message-ID: <87k4xhh7v4.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > > Hmm, strange. In http://thread.gmane.org/gmane.emacs.bugs/16956 > > you requested us to remove highlighting when there are additional > > filters on the grep output. So we changed `--color=always' into > > `--color=auto' that broke the highlighting in zgrep output because > > zgrep uses additional filters. > Maybe zgrep is careful to distinguish filters on the input from > filters on the output. AFAICT zgrep only uses a filter on the input, > so it should work. IIUC, zgrep puts a sed filter on the grep output to replace "(standard input)" strings with real file names. -- Juri Linkov http://www.jurta.org/emacs/ From jidanni@jidanni.org Mon Nov 23 12:35:53 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 23 Nov 2009 20:35:53 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, SARE_RECV_SPAM_DOMN0b autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from homiemail-a37.g.dreamhost.com (caiajhbdcbhh.dreamhost.com [208.97.132.177]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nANKZpxr018933 for <4982@emacsbugs.donarmstrong.com>; Mon, 23 Nov 2009 12:35:53 -0800 Received: from jidanni.org (218-163-1-207.dynamic.hinet.net [218.163.1.207]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by homiemail-a37.g.dreamhost.com (Postfix) with ESMTP id 198C84D711; Mon, 23 Nov 2009 12:36:16 -0800 (PST) From: jidanni@jidanni.org To: juri@jurta.org Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files References: <876391imuv.fsf@mail.jurta.org> Date: Tue, 24 Nov 2009 04:18:21 +0800 Message-ID: <874oolxaeq.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> "JL" == Juri Linkov writes: JL> So you don't see yellow matches? OK, I do if I mouseover them. By the way, some ugliness now that I set grep-command to zgrep: gzip: stdout: Broken pipe ./libchewing3-data_0.3.0-2_i386.deb:Binary file (standard input) matches gzip: stdout: Broken pipe ./Nokia_3315_APAC_UG_En.pdf:Binary file (standard input) matches From juri@jurta.org Tue Nov 24 09:15:41 2009 Received: (at 4982) by emacsbugs.donarmstrong.com; 24 Nov 2009 17:15:42 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.starman.ee (smtp-out3.starman.ee [85.253.0.5]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAOHFeVg002950 for <4982@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 09:15:41 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.34.225.cable.starman.ee [82.131.34.225]) by mx1.starman.ee (Postfix) with ESMTP id 31B713F412C; Tue, 24 Nov 2009 19:15:34 +0200 (EET) From: Juri Linkov To: jidanni@jidanni.org Cc: 4982@debbugs.gnu.org Subject: Re: bug#4982: rgrep can't deal with .gz files Organization: JURTA References: <876391imuv.fsf@mail.jurta.org> <874oolxaeq.fsf@jidanni.org> Date: Tue, 24 Nov 2009 19:04:43 +0200 In-Reply-To: <874oolxaeq.fsf@jidanni.org> (jidanni@jidanni.org's message of "Tue, 24 Nov 2009 04:18:21 +0800") Message-ID: <87fx84ujec.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > JL> So you don't see yellow matches? > OK, I do if I mouseover them. By the way, some ugliness now that I set > grep-command to zgrep: > > gzip: stdout: Broken pipe > ./libchewing3-data_0.3.0-2_i386.deb:Binary file (standard input) matches > > gzip: stdout: Broken pipe > ./Nokia_3315_APAC_UG_En.pdf:Binary file (standard input) matches Yes, zgrep incorrectly processes non-gzipped files. To search recursively in gzipped files, I created a new command `zrgrep'. It works like `rgrep' but uses `zgrep' for `grep-program', sets the default file name to `*.gz', and sets `grep-highlight-matches' to `always'." Other changes in the patch below include: 1. grep-highlight-matches has two new options `always' and `auto'. This allows `zrgrep' to override the default value with `always'. 2. Move Windows/DOS specific --colors settings handling from `grep-process-setup' to `grep-compute-defaults'. Index: lisp/progmodes/grep.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v retrieving revision 1.111 diff -c -r1.111 grep.el *** lisp/progmodes/grep.el 19 Nov 2009 17:37:25 -0000 1.111 --- lisp/progmodes/grep.el 24 Nov 2009 17:04:11 -0000 *************** *** 69,90 **** :group 'grep) (defcustom grep-highlight-matches 'auto-detect ! "If t, use special markers to highlight grep matches. Some grep programs are able to surround matches with special markers in grep output. Such markers can be used to highlight matches in grep mode. ! This option sets the environment variable GREP_COLOR to specify markers for highlighting and GREP_OPTIONS to add the --color option in front of any explicit grep options before starting the grep. In interactive usage, the actual value of this variable is set up ! by `grep-compute-defaults'; to change the default value, use ! Customize or call the function `grep-apply-setting'." :type '(choice (const :tag "Do not highlight matches with grep markers" nil) (const :tag "Highlight matches with grep markers" t) (other :tag "Not Set" auto-detect)) :set 'grep-apply-setting :version "22.1" --- 69,102 ---- :group 'grep) (defcustom grep-highlight-matches 'auto-detect ! "Use special markers to highlight grep matches. Some grep programs are able to surround matches with special markers in grep output. Such markers can be used to highlight matches in grep mode. ! This option sets the environment variable GREP_COLORS to specify markers for highlighting and GREP_OPTIONS to add the --color option in front of any explicit grep options before starting the grep. + When this option is `auto', grep uses `--color=auto' to highlight + matches only when it outputs to a terminal (when `grep' is the last + command in the pipe), thus avoiding the use of any potentially-harmful + escape sequences when standard output goes to a file or pipe. + + To make grep highlight matches even into a pipe, you need the option + `always' that forces grep to use `--color=always' to unconditionally + output escape sequences. + In interactive usage, the actual value of this variable is set up ! by `grep-compute-defaults' when the default value is `auto-detect'. ! To change the default value, use Customize or call the function ! `grep-apply-setting'." :type '(choice (const :tag "Do not highlight matches with grep markers" nil) (const :tag "Highlight matches with grep markers" t) + (const :tag "Use --color=always" always) + (const :tag "Use --color=auto" auto) (other :tag "Not Set" auto-detect)) :set 'grep-apply-setting :version "22.1" *************** *** 442,460 **** (defun grep-process-setup () "Setup compilation variables and buffer for `grep'. Set up `compilation-exit-message-function' and run `grep-setup-hook'." ! (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) (grep-compute-defaults)) ! (when (eq grep-highlight-matches t) ;; `setenv' modifies `process-environment' let-bound in `compilation-start' ;; Any TERM except "dumb" allows GNU grep to use `--color=auto' (setenv "TERM" "emacs-grep") - ;; `--color=auto' emits escape sequences on a tty rather than on a pipe, - ;; thus allowing to use multiple grep filters on the command line - ;; and to output escape sequences only on the final grep output (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") ! ;; Windows and DOS pipes fail `isatty' detection in Grep. ! " --color=" (if (memq system-type '(windows-nt ms-dos)) "always" "auto"))) ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions (setenv "GREP_COLOR" "01;31") --- 454,469 ---- (defun grep-process-setup () "Setup compilation variables and buffer for `grep'. Set up `compilation-exit-message-function' and run `grep-setup-hook'." ! (when (eq grep-highlight-matches 'auto-detect) (grep-compute-defaults)) ! (unless (or (eq grep-highlight-matches 'auto-detect) ! (null grep-highlight-matches)) ;; `setenv' modifies `process-environment' let-bound in `compilation-start' ;; Any TERM except "dumb" allows GNU grep to use `--color=auto' (setenv "TERM" "emacs-grep") (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") ! " --color=" (if (eq grep-highlight-matches 'always) "always" "auto"))) ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions (setenv "GREP_COLOR" "01;31") *************** *** 579,592 **** (t (format "%s . -type f -print | %s %s" find-program xargs-program gcmd)))))))) ! (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) (setq grep-highlight-matches (with-temp-buffer (and (grep-probe grep-program '(nil t nil "--help")) (progn (goto-char (point-min)) (search-forward "--color" nil t)) ! t)))) ;; Save defaults for this host. (setq grep-host-defaults-alist --- 588,603 ---- (t (format "%s . -type f -print | %s %s" find-program xargs-program gcmd)))))))) ! (when (eq grep-highlight-matches 'auto-detect) (setq grep-highlight-matches (with-temp-buffer (and (grep-probe grep-program '(nil t nil "--help")) (progn (goto-char (point-min)) (search-forward "--color" nil t)) ! ;; Windows and DOS pipes fail `isatty' detection in Grep. ! (if (memq system-type '(windows-nt ms-dos)) ! 'always 'auto))))) ;; Save defaults for this host. (setq grep-host-defaults-alist *************** *** 978,983 **** --- 993,1030 ---- (if (eq next-error-last-buffer (current-buffer)) (setq default-directory dir))))))) + ;;;###autoload + (defun zrgrep (regexp &optional files dir confirm grep-find-template) + "Recursively grep for REGEXP in gzipped FILES in tree rooted at DIR. + Like `rgrep' but uses `zgrep' for `grep-program', sets the default + file name to `*.gz', and sets `grep-highlight-matches' to `always'." + (interactive + (let ((grep-program "zgrep") + (grep-find-command nil) + (grep-find-template nil) + (grep-host-defaults-alist nil) + (grep-files-aliases '(("*.gz" . "*.gz") ; for `grep-read-files' + ("all" . "* .*")))) + ;; Recompute defaults using let-bound values above. + (grep-compute-defaults) + (cond + ((and grep-find-command (equal current-prefix-arg '(16))) + (list (read-from-minibuffer "Run: " grep-find-command + nil nil 'grep-find-history))) + ((not grep-find-template) + (error "grep.el: No `grep-find-template' available")) + (t (let* ((regexp (grep-read-regexp)) + (files (grep-read-files regexp)) + (dir (read-directory-name "Base directory: " + nil default-directory t)) + (confirm (equal current-prefix-arg '(4)))) + (list regexp files dir confirm grep-find-template)))))) + ;; Set `grep-highlight-matches' to `always' + ;; since `zgrep' puts filters in the grep output. + (let ((grep-highlight-matches 'always)) + ;; `rgrep' uses the dynamically bound value `grep-find-template' + ;; from the argument `grep-find-template' whose value is computed + ;; in the `interactive' spec. + (rgrep regexp files dir confirm))) ;;;###autoload (defalias 'rzgrep 'zrgrep) (provide 'grep) -- Juri Linkov http://www.jurta.org/emacs/ From juri@jurta.org Wed Nov 25 09:31:40 2009 Received: (at 4982-done) by emacsbugs.donarmstrong.com; 25 Nov 2009 17:31:40 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.starman.ee (smtp-out3.starman.ee [85.253.0.5]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAPHVcQt010130 for <4982-done@emacsbugs.donarmstrong.com>; Wed, 25 Nov 2009 09:31:39 -0800 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.52.48.cable.starman.ee [82.131.52.48]) by mx1.starman.ee (Postfix) with ESMTP id B69D13F416A; Wed, 25 Nov 2009 19:31:31 +0200 (EET) From: Juri Linkov To: 4982-done@debbugs.gnu.org Cc: jidanni@jidanni.org Subject: Re: bug#4982: rgrep can't deal with .gz files Organization: JURTA References: <876391imuv.fsf@mail.jurta.org> <874oolxaeq.fsf@jidanni.org> <87fx84ujec.fsf@mail.jurta.org> Date: Wed, 25 Nov 2009 19:28:14 +0200 In-Reply-To: <87fx84ujec.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 24 Nov 2009 19:04:43 +0200") Message-ID: <87y6lu7gq6.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >> By the way, some ugliness now that I set grep-command to zgrep: >> >> gzip: stdout: Broken pipe >> ./libchewing3-data_0.3.0-2_i386.deb:Binary file (standard input) matches >> >> gzip: stdout: Broken pipe >> ./Nokia_3315_APAC_UG_En.pdf:Binary file (standard input) matches > > Yes, zgrep incorrectly processes non-gzipped files. To search > recursively in gzipped files, I created a new command `zrgrep'. > It works like `rgrep' but uses `zgrep' for `grep-program', sets the default > file name to `*.gz', and sets `grep-highlight-matches' to `always'." I installed a new command `zrgrep' to search recursively in gzipped files. -- Juri Linkov http://www.jurta.org/emacs/ From unknown Sun Jun 22 00:49:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 24 Dec 2009 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator