Subject: bug#4210: patch

From: Eric Hanchrow <[email-masked]>
Date: Fri, 21 Aug 2009 07:09:07 -0700

This fixes it for me:

commit cbe538a4b0c80348b3a43b2a16c7d9cca1177b97
Author: Eric Hanchrow <[email-masked]>
Date:   Wed Aug 19 22:28:31 2009 -0700

    grep-read-files: consult (buffer-name (buffer-base-buffer)), not
just (buffer-name).

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 9e63c1d..a1a89d0 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -747,7 +747,7 @@ substitution string.  Note dynamic scoping of variables.")

 (defun grep-read-files (regexp)
   "Read files arg for interactive grep."
-  (let* ((bn (or (buffer-file-name) (buffer-name)))
+  (let* ((bn (or (buffer-file-name) (buffer-name (buffer-base-buffer))))
 	 (fn (and bn
 		  (stringp bn)
 		  (file-name-nondirectory bn)))