aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorJuri Linkov2009-08-30 23:47:11 +0000
committerJuri Linkov2009-08-30 23:47:11 +0000
commit6830f44933dc2fc9ce64f21144c7b9b57342a8e1 (patch)
tree3e9cafb31f917789a7ca778cf63a5b8d3e2223ed /lisp/progmodes
parent08166ed65fa9660e6f6365520d0ef5ac71a1645e (diff)
downloademacs-6830f44933dc2fc9ce64f21144c7b9b57342a8e1.tar.gz
emacs-6830f44933dc2fc9ce64f21144c7b9b57342a8e1.zip
(grep-read-files): Strip trailing <N> from buffer names
not visiting a file (e.g. cloned buffers).
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/grep.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 5c199016c65..bf626f6e308 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -748,7 +748,8 @@ substitution string. Note dynamic scoping of variables.")
748 748
749(defun grep-read-files (regexp) 749(defun grep-read-files (regexp)
750 "Read files arg for interactive grep." 750 "Read files arg for interactive grep."
751 (let* ((bn (or (buffer-file-name) (buffer-name))) 751 (let* ((bn (or (buffer-file-name)
752 (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))
752 (fn (and bn 753 (fn (and bn
753 (stringp bn) 754 (stringp bn)
754 (file-name-nondirectory bn))) 755 (file-name-nondirectory bn)))