From 02b404de99985e6f86fe0f2e0969d281a875313e Mon Sep 17 00:00:00 2001
From: Juri Linkov <juri@jurta.org>
Date: Wed, 17 Aug 2011 20:11:49 +0300
Subject: [PATCH] * lisp/progmodes/grep.el (rgrep): Handle the case when
 `grep-find-command' is a cons cell.

Fixes: debbugs:9278
---
 lisp/ChangeLog         | 5 +++++
 lisp/progmodes/grep.el | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f3d37a77b24..38a463ddb58 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-17  Juri Linkov  <juri@jurta.org>
+
+	* progmodes/grep.el (rgrep): Handle the case when
+	`grep-find-command' is a cons cell (bug#9278).
+
 2011-08-17  Martin Rudalics  <rudalics@gmx.at>
 
 	* window.el (display-buffer-pop-up-frame): Run frame creation
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index db8e82193b3..31100f3fac2 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -965,7 +965,9 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]."
     (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'
-- 
2.39.5