GNU bug report logs - #9278
rgrep fails on grep-find-command

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Wed, 10 Aug 2011 19:59:02 UTC

Severity: normal

Tags: patch

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juri Linkov <juri <at> jurta.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#9278: closed (rgrep fails on grep-find-command)
Date: Wed, 17 Aug 2011 17:17:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 17 Aug 2011 20:12:47 +0300
with message-id <87pqk4klm8.fsf <at> mail.jurta.org>
and subject line Re: bug#9278: rgrep fails on grep-find-command
has caused the GNU bug report #9278,
regarding rgrep fails on grep-find-command
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
9278: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9278
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: rgrep fails on grep-find-command
Date: Wed, 10 Aug 2011 22:38:05 +0300
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'



[Message part 3 (message/rfc822, inline)]
From: Juri Linkov <juri <at> jurta.org>
To: 9278-done <at> debbugs.gnu.org
Subject: Re: bug#9278: rgrep fails on grep-find-command
Date: Wed, 17 Aug 2011 20:12:47 +0300
Fixed.


This bug report was last modified 14 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.