--- Begin Message ---
Subject: |
rgrep fails on grep-find-command |
Date: |
Wed, 10 Aug 2011 22:38:05 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) |
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'
--- End Message ---