From unknown Thu Sep 11 23:18:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9278 <9278@debbugs.gnu.org> To: bug#9278 <9278@debbugs.gnu.org> Subject: Status: rgrep fails on grep-find-command Reply-To: bug#9278 <9278@debbugs.gnu.org> Date: Fri, 12 Sep 2025 06:18:39 +0000 retitle 9278 rgrep fails on grep-find-command reassign 9278 emacs submitter 9278 Juri Linkov severity 9278 normal tag 9278 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 10 15:58:26 2011 Received: (at submit) by debbugs.gnu.org; 10 Aug 2011 19:58:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QrEv3-0004iP-R1 for submit@debbugs.gnu.org; Wed, 10 Aug 2011 15:58:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QrEv1-0004iI-8o for submit@debbugs.gnu.org; Wed, 10 Aug 2011 15:58:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrEep-0005x5-7l for submit@debbugs.gnu.org; Wed, 10 Aug 2011 15:41:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:51486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrEek-0005qg-Ni for submit@debbugs.gnu.org; Wed, 10 Aug 2011 15:41:34 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrEeZ-0000DM-Kc for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2011 15:41:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrEeT-0005kQ-MR for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2011 15:41:22 -0400 Received: from smarty.dreamhost.com ([208.113.175.8]:34396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrEeT-0005kJ-DP for bug-gnu-emacs@gnu.org; Wed, 10 Aug 2011 15:41:17 -0400 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 42ED76E8077 for ; Wed, 10 Aug 2011 12:41:16 -0700 (PDT) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 7A114451C366 for ; Wed, 10 Aug 2011 12:41:15 -0700 (PDT) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: rgrep fails on grep-find-command Organization: JURTA Date: Wed, 10 Aug 2011 22:38:05 +0300 Message-ID: <871uwtt5uq.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) Tags: patch With some grep default values, typing `C-u C-u M-x rgrep RET M-p RET' fails with: (wrong-type-argument stringp ("find . -type f -exec grep -inH -e {} +" . 35)) because `grep-compute-defaults' computes the default value of `grep-find-command' to ("find . -type f -exec grep -inH -e {} +" . 35) i.e. a cons of (STRING . POSITION) for INITIAL-CONTENTS of `read-from-minibuffer' in `rgrep' and `grep-find'. I don't know why `grep-find-command' has such a format (that also is not documented in its docstring), but currently I don't see a better solution. So unless someone can propose a better fix, I'd like to install: === modified file 'lisp/progmodes/grep.el' --- lisp/progmodes/grep.el 2011-08-10 18:15:32 +0000 +++ lisp/progmodes/grep.el 2011-08-10 19:30:02 +0000 @@ -965,7 +965,9 @@ (defun rgrep (regexp &optional files dir (unless (and dir (file-directory-p dir) (file-readable-p dir)) (setq dir default-directory)) (if (null files) - (if (not (string= regexp grep-find-command)) + (if (not (string= regexp (if (consp grep-find-command) + (car grep-find-command) + grep-find-command))) (compilation-start regexp 'grep-mode)) (setq dir (file-name-as-directory (expand-file-name dir))) (require 'find-dired) ; for `find-name-arg' From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 17 13:16:08 2011 Received: (at 9278-done) by debbugs.gnu.org; 17 Aug 2011 17:16:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qtjiq-0008Po-21 for submit@debbugs.gnu.org; Wed, 17 Aug 2011 13:16:08 -0400 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qtjio-0008Ph-HK for 9278-done@debbugs.gnu.org; Wed, 17 Aug 2011 13:16:07 -0400 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 3EA126E80A0 for <9278-done@debbugs.gnu.org>; Wed, 17 Aug 2011 10:14:11 -0700 (PDT) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id A1466451C281 for <9278-done@debbugs.gnu.org>; Wed, 17 Aug 2011 10:14:10 -0700 (PDT) From: Juri Linkov To: 9278-done@debbugs.gnu.org Subject: Re: bug#9278: rgrep fails on grep-find-command Organization: JURTA References: <871uwtt5uq.fsf@mail.jurta.org> Date: Wed, 17 Aug 2011 20:12:47 +0300 In-Reply-To: <871uwtt5uq.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 10 Aug 2011 22:38:05 +0300") Message-ID: <87pqk4klm8.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 9278-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Fixed. From unknown Thu Sep 11 23:18:39 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, 15 Sep 2011 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator