changeset 104745:60a123e396f8

(grep-read-files): Strip trailing <N> from buffer names not visiting a file (e.g. cloned buffers).
author Juri Linkov <juri@jurta.org>
date Sun, 30 Aug 2009 23:46:09 +0000
parents 58318daad0c3
children d57836f95b31
files lisp/progmodes/grep.el
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/grep.el	Sun Aug 30 23:31:26 2009 +0000
+++ b/lisp/progmodes/grep.el	Sun Aug 30 23:46:09 2009 +0000
@@ -748,7 +748,8 @@
 
 (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)
+		 (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))
 	 (fn (and bn
 		  (stringp bn)
 		  (file-name-nondirectory bn)))