GNU bug report logs -
#4210
23.1.50; lgrep chooses silly default value for file extension
Previous Next
Full log
Message #15 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
Eric Hanchrow wrote:
> Please write in English if possible, because the Emacs maintainers
> usually do not have translators to read other languages for them.
>
> Your bug report will be posted to the emacs-pretest-bug <at> gnu.org mailing list.
>
> Please describe exactly what actions triggered the bug
> and the precise symptoms of the bug:
>
> I visited a python file
>
> C-x C-f ~ / l o c TAB RET b i n RET . p y RET
>
> (I happen to have a bunch of python files in ~/local/bin, and I have
> ido-mode turned on)
>
> I cloned the buffer:
>
> C-x 4 c
>
> I used lgrep to search:
>
> ESC x l g r e p RET ^ c l a s s RET RET RET
>
>
> At this point I was looking at a *grep* buffer like this:
>
> -*- mode: grep; default-directory: "~/local/bin/" -*-
> Grep started at Wed Aug 19 19:17:41
>
> grep -i -nH -e \^class *.py<2>
> /bin/bash: -c: line 0: syntax error near unexpected token `2'
> /bin/bash: -c: line 0: `grep -i -nH -e \^class *.py<2>'
>
> Grep exited abnormally with code 2 at Wed Aug 19 19:17:41
>
> Naturally the "grep" command should have been
>
> grep -i -nH -e \^class *.py
>
> i.e., the "<2>" shouldn't have been put in there.
2009-08-23 Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
* progmodes/grep.el (grep-read-files): Strip trailing <N> from
buffer names not visiting a file (e.g. cloned buffers).
*** grep.el~ Sun Aug 23 11:51:39 2009
--- grep.el Sun Aug 23 11:52:37 2009
***************
*** 747,753 ****
(defun grep-read-files (regexp)
"Read files arg for interactive grep."
! (let* ((bn (or (buffer-file-name) (buffer-name)))
(fn (and bn
(stringp bn)
(file-name-nondirectory bn)))
--- 747,754 ----
(defun grep-read-files (regexp)
"Read files arg for interactive grep."
! (let* ((bn (or (buffer-file-name)
! (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))
(fn (and bn
(stringp bn)
(file-name-nondirectory bn)))
--
Kevin Rodgers
Denver, Colorado, USA
This bug report was last modified 15 years and 268 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.