unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4052: Emacs hangs with C-u C-u lrgep
@ 2009-08-05 22:17 ` Juri Linkov
  2009-08-12 21:05   ` bug#4052: marked as done (Emacs hangs with C-u C-u lrgep) Emacs bug Tracking System
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2009-08-05 22:17 UTC (permalink / raw)
  To: emacs-pretest-bug

Emacs hangs and every keystroke beeps with error messages like

  cd: Wrong type argument: stringp, nil
  file-remote-p: Wrong type argument: stringp, nil

because `C-u C-u M-x lrgep M-p RET' sets `default-directory' to nil.

I believe this is the correct fix:

Index: lisp/progmodes/grep.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.102
diff -u -r1.102 grep.el
--- lisp/progmodes/grep.el	8 Jul 2009 14:24:00 -0000	1.102
+++ lisp/progmodes/grep.el	5 Aug 2009 22:17:36 -0000
@@ -827,7 +827,7 @@
 					  command nil nil 'grep-history))
 	    (add-to-history 'grep-history command))))
       (when command
-	(let ((default-directory dir))
+	(let ((default-directory (or dir default-directory)))
 	  ;; Setting process-setup-function makes exit-message-function work
 	  ;; even when async processes aren't supported.
 	  (compilation-start (if (and grep-use-null-device null-device)

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4052: marked as done (Emacs hangs with C-u C-u lrgep)
  2009-08-05 22:17 ` bug#4052: Emacs hangs with C-u C-u lrgep Juri Linkov
@ 2009-08-12 21:05   ` Emacs bug Tracking System
  2009-08-21  0:21     ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-08-12 21:05 UTC (permalink / raw)
  To: Juri Linkov

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]


Your message dated Wed, 12 Aug 2009 23:58:55 +0300
with message-id <87zla4kauo.fsf@mail.jurta.org>
and subject line Re: bug#4052: Emacs hangs with C-u C-u lrgep
has caused the Emacs bug report #4052,
regarding Emacs hangs with C-u C-u lrgep
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4052: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4052
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3020 bytes --]

From: Juri Linkov <juri@jurta.org>
To: emacs-pretest-bug@gnu.org
Subject: Emacs hangs with C-u C-u lrgep
Date: Thu, 06 Aug 2009 01:17:43 +0300
Message-ID: <877hxh7u9c.fsf@mail.jurta.org>

Emacs hangs and every keystroke beeps with error messages like

  cd: Wrong type argument: stringp, nil
  file-remote-p: Wrong type argument: stringp, nil

because `C-u C-u M-x lrgep M-p RET' sets `default-directory' to nil.

I believe this is the correct fix:

Index: lisp/progmodes/grep.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.102
diff -u -r1.102 grep.el
--- lisp/progmodes/grep.el	8 Jul 2009 14:24:00 -0000	1.102
+++ lisp/progmodes/grep.el	5 Aug 2009 22:17:36 -0000
@@ -827,7 +827,7 @@
 					  command nil nil 'grep-history))
 	    (add-to-history 'grep-history command))))
       (when command
-	(let ((default-directory dir))
+	(let ((default-directory (or dir default-directory)))
 	  ;; Setting process-setup-function makes exit-message-function work
 	  ;; even when async processes aren't supported.
 	  (compilation-start (if (and grep-use-null-device null-device)

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


[-- Attachment #3: Type: message/rfc822, Size: 1774 bytes --]

From: Juri Linkov <juri@jurta.org>
To: 4052-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4052: Emacs hangs with C-u C-u lrgep
Date: Wed, 12 Aug 2009 23:58:55 +0300
Message-ID: <87zla4kauo.fsf@mail.jurta.org>

> Emacs hangs and every keystroke beeps with error messages like
>
>   cd: Wrong type argument: stringp, nil
>   file-remote-p: Wrong type argument: stringp, nil
>
> because `C-u C-u M-x lrgep M-p RET' sets `default-directory' to nil.
>
> I believe this is the correct fix:

Fixed.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4052: marked as done (Emacs hangs with C-u C-u lrgep)
  2009-08-12 21:05   ` bug#4052: marked as done (Emacs hangs with C-u C-u lrgep) Emacs bug Tracking System
@ 2009-08-21  0:21     ` Glenn Morris
  2009-08-22  0:18       ` Juri Linkov
  0 siblings, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2009-08-21  0:21 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 4052


> Fixed.

Are you sure this is fixed?

emacs -Q
M-x lgrep RET foo RET RET RET
select grep buffer
C-u C-u M-x lgrep RET M-p RET

-> default-directory is now nil in the grep buffer (eg the scroll bars
vanish)

The very last clause in lgrep

(if (eq next-error-last-buffer (current-buffer))
        (setq default-directory dir))

is outside the let-binding that you changed.


Also, regardless of the above, does rgrep need the same kind of fix as lgrep?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4052: marked as done (Emacs hangs with C-u C-u lrgep)
  2009-08-21  0:21     ` Glenn Morris
@ 2009-08-22  0:18       ` Juri Linkov
  0 siblings, 0 replies; 4+ messages in thread
From: Juri Linkov @ 2009-08-22  0:18 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4052

>> Fixed.
>
> Are you sure this is fixed?
>
> emacs -Q
> M-x lgrep RET foo RET RET RET
> select grep buffer
> C-u C-u M-x lgrep RET M-p RET
>
> -> default-directory is now nil in the grep buffer (eg the scroll bars
> vanish)
>
> The very last clause in lgrep
>
> (if (eq next-error-last-buffer (current-buffer))
>         (setq default-directory dir))
>
> is outside the let-binding that you changed.

Oops, I missed this case.  Now fixed by checking for a non-nil
readable directory at the beginning of this command.

> Also, regardless of the above, does rgrep need the same kind of fix as lgrep?

When used interactively, rgrep doesn't need the same fix because it uses
a slightly different logic.  But this is needed when rgrep is called
programmatically with an invalid `dir' argument.

`lgrep' and `rgrep' are still different in regard to their argument `dir'.
When `lgrep' is called programmatically with a non-nil `regexp' and `dir'
but with `files'=nil, then `lgrep' runs in the directory `dir'.  However,
when `rgrep' is called with the same arguments, it runs in the current
directory.  I'm not sure if this behavior should be the same for both.

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-22  0:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87zla4kauo.fsf@mail.jurta.org>
2009-08-05 22:17 ` bug#4052: Emacs hangs with C-u C-u lrgep Juri Linkov
2009-08-12 21:05   ` bug#4052: marked as done (Emacs hangs with C-u C-u lrgep) Emacs bug Tracking System
2009-08-21  0:21     ` Glenn Morris
2009-08-22  0:18       ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).