GNU bug report logs - #4210
23.1.50; lgrep chooses silly default value for file extension

Previous Next

Package: emacs;

Reported by: Eric Hanchrow <eric.hanchrow <at> gmail.com>

Date: Thu, 20 Aug 2009 20:35:08 UTC

Severity: normal

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4210 in the body.
You can then email your comments to 4210 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4210; Package emacs. (Thu, 20 Aug 2009 20:35:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Hanchrow <eric.hanchrow <at> gmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 20 Aug 2009 20:35:09 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Eric Hanchrow <eric.hanchrow <at> gmail.com>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.1.50; lgrep chooses silly default value for file extension
Date: Wed, 19 Aug 2009 19:20:33 -0700
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.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/local/src/emacs/etc/DEBUG for instructions.



In GNU Emacs 23.1.50.2 (i686-pc-linux-gnu, GTK+ Version 2.12.12)
 of 2009-08-17 on debian
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Python

Minor modes in effect:
  shell-dirtrack-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-autojoin-mode: t
  erc-log-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  global-auto-revert-mode: t
  display-time-mode: t
  tooltip-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:

Recent messages:
Making completion list...
prep-new-frame: considering #<frame F4 0x9755a38>; SSH_TTY is /dev/pts/0
When done with this frame, type C-x 5 0
Corrections: displays displays display misplays displace displease dispels splays
Mark set
prep-new-frame: considering #<frame F5 0x97c7748>; SSH_TTY is /dev/pts/5
When done with this frame, type C-x 5 0
Quit
Loading tramp...done
Grep exited abnormally with code 2

Load-path shadows:
~/.emacs.d/custom hides /usr/local/src/emacs/lisp/custom

-- 
If there were a little guy running around inside the computer
executing our programs, he would probably have as long and
plaintive a tale to tell about his job as a federal government
employee.
        -- Paul Graham




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4210; Package emacs. (Fri, 21 Aug 2009 14:15:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Hanchrow <eric.hanchrow <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 21 Aug 2009 14:15:06 GMT) Full text and rfc822 format available.

Message #10 received at 4210 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Eric Hanchrow <eric.hanchrow <at> gmail.com>
To: 4210 <at> debbugs.gnu.org
Subject: patch
Date: Fri, 21 Aug 2009 07:09:07 -0700
This fixes it for me:

commit cbe538a4b0c80348b3a43b2a16c7d9cca1177b97
Author: Eric Hanchrow <erich <at> cozi.com>
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)))



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4210; Package emacs. (Sun, 23 Aug 2009 18:10:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kevin Rodgers <kevin.d.rodgers <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 23 Aug 2009 18:10:06 GMT) Full text and rfc822 format available.

Message #15 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: emacs-pretest-bug <at> gnu.org
Subject: Re: bug#4210: 23.1.50;   lgrep chooses silly default value for file
 extension
Date: Sun, 23 Aug 2009 12:02:51 -0600
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





Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Sun, 30 Aug 2009 23:55:07 GMT) Full text and rfc822 format available.

Notification sent to Eric Hanchrow <eric.hanchrow <at> gmail.com>:
bug acknowledged by developer. (Sun, 30 Aug 2009 23:55:07 GMT) Full text and rfc822 format available.

Message #20 received at 4210-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
Cc: 4210-done <at> debbugs.gnu.org
Subject: Re: bug#4210: 23.1.50; lgrep chooses silly default value for file extension
Date: Mon, 31 Aug 2009 02:47:54 +0300
Thank you.

-- 
Juri Linkov
http://www.jurta.org/emacs/



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Mon, 28 Sep 2009 14:24:12 GMT) Full text and rfc822 format available.

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.