unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
@ 2017-09-24 13:10 Teemu Likonen
  2017-09-24 23:11 ` John Wiegley
  2017-09-25 22:48 ` Dmitry Gutov
  0 siblings, 2 replies; 10+ messages in thread
From: Teemu Likonen @ 2017-09-24 13:10 UTC (permalink / raw)
  To: 28575

Dired mode command "Q" (dired-do-find-regexp-and-replace) fails when
user has deleted a directory in the same Emacs session. Steps to
reproduce:

 1. Create test files:

    $ mkdir dir1 dir2
    $ touch dir1/file1 dir2/file2

 2. Start Emacs in dired-mode inside "dir1":

    $ emacs -Q dir1

    /home/dtw/tmp/dir1:
    total used in directory 0 available 16454160
    drwxr-xr-x 2 dtw  dtw  60 2017-09-24 16:02:00 .
    drwxrwxrwt 4 root root 80 2017-09-24 16:02:00 ..
    -rw-r--r-- 1 dtw  dtw   0 2017-09-24 16:02:00 file1

 3. Mark the "file1" with command "m" (dired-mark).

 4. Type command "Q" (dired-do-find-regexp-and-replace) and type any
    strings to the regexp and replace prompts.

 5. Go one directory up with command "^" (dired-up-directory).

    /home/dtw/tmp:
    total used in directory 4 available 16454160
    drwxrwxrwt  4 root root   80 2017-09-24 16:02:00 .
    drwxr-xr-x 61 dtw  dtw  4096 2017-09-24 15:42:49 ..
    drwxr-xr-x  2 dtw  dtw    60 2017-09-24 16:02:00 dir1
    drwxr-xr-x  2 dtw  dtw    60 2017-09-24 16:02:00 dir2

 6. Use "D" (dired-do-delete) to delete "dir1" (confirm with "yes"
    twice).

 7. Go to "dir2".

    /home/dtw/tmp/dir2:
    total used in directory 0 available 16454160
    drwxr-xr-x 2 dtw  dtw  60 2017-09-24 16:02:00 .
    drwxrwxrwt 3 root root 60 2017-09-24 16:03:32 ..
    -rw-r--r-- 1 dtw  dtw   0 2017-09-24 16:02:00 file2

 8. Mark the "file2" with command "m" (dired-mark).

 9. Type command "Q" (dired-do-find-regexp-and-replace) and enter some
    strings to regexp and replace prompts.

10. There will be the following error in the echo area and the
    *Messages* buffer:

        call-process-shell-command: Setting current directory: No such
        file or directory, ~/tmp/dir1/

    And the command "Q" can't be performed.





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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-24 13:10 bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory Teemu Likonen
@ 2017-09-24 23:11 ` John Wiegley
  2017-09-25  3:29   ` Teemu Likonen
  2017-09-25 22:48 ` Dmitry Gutov
  1 sibling, 1 reply; 10+ messages in thread
From: John Wiegley @ 2017-09-24 23:11 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: 28575

>>>>> "TL" == Teemu Likonen <tlikonen@iki.fi> writes:

TL> Dired mode command "Q" (dired-do-find-regexp-and-replace) fails when user
TL> has deleted a directory in the same Emacs session. Steps to reproduce:

Thanks for these excellent reproduction steps.  After you delete dir1, is
there still a buffer open visiting the contents of file1?

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2





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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-24 23:11 ` John Wiegley
@ 2017-09-25  3:29   ` Teemu Likonen
  2017-09-25  4:28     ` John Wiegley
  0 siblings, 1 reply; 10+ messages in thread
From: Teemu Likonen @ 2017-09-25  3:29 UTC (permalink / raw)
  To: John Wiegley; +Cc: 28575

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

John Wiegley [2017-09-24 16:11:10-07] wrote:

>>>>>> "TL" == Teemu Likonen <tlikonen@iki.fi> writes:
> TL> Dired mode command "Q" (dired-do-find-regexp-and-replace) fails
> TL> when user has deleted a directory in the same Emacs session. Steps
> TL> to reproduce:

> After you delete dir1, is there still a buffer open visiting the
> contents of file1?

No. Emacs is not visiting "file1". We can also add step 4.5 to do "U"
(dired-unmark-all-marks) and step 5.5 to manually kill "dir1" buffer but
it does not matter. The error is the same and the "Q" command
(dired-do-find-regexp-and-replace) doesn't work anymore in the same
Emacs session.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-25  3:29   ` Teemu Likonen
@ 2017-09-25  4:28     ` John Wiegley
  2017-09-25 22:43       ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: John Wiegley @ 2017-09-25  4:28 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: 28575

>>>>> Teemu Likonen <tlikonen@iki.fi> writes:

> No. Emacs is not visiting "file1". We can also add step 4.5 to do "U"
> (dired-unmark-all-marks) and step 5.5 to manually kill "dir1" buffer but it
> does not matter. The error is the same and the "Q" command
> (dired-do-find-regexp-and-replace) doesn't work anymore in the same Emacs
> session.

Your steps didn't reproduce for me with the emacs-26 release branch.

Step #6 failed with "Removing directory directory not empty /tmp/dir1".

So I deleted file1, then was able to delete dir1, and the rest of your steps
completed successfully here.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2





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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-25  4:28     ` John Wiegley
@ 2017-09-25 22:43       ` Dmitry Gutov
  2017-09-26  3:28         ` John Wiegley
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2017-09-25 22:43 UTC (permalink / raw)
  To: John Wiegley, Teemu Likonen; +Cc: 28575

On 9/25/17 7:28 AM, John Wiegley wrote:

> Your steps didn't reproduce for me with the emacs-26 release branch.
> 
> Step #6 failed with "Removing directory directory not empty /tmp/dir1".
> 
> So I deleted file1, then was able to delete dir1, and the rest of your steps
> completed successfully here.

Thanks, but that's odd, I've managed to reproduce it fine. Fix incoming.






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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-24 13:10 bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory Teemu Likonen
  2017-09-24 23:11 ` John Wiegley
@ 2017-09-25 22:48 ` Dmitry Gutov
  1 sibling, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2017-09-25 22:48 UTC (permalink / raw)
  To: Teemu Likonen, 28575-done

Version: 26.1

On 9/24/17 4:10 PM, Teemu Likonen wrote:
> Dired mode command "Q" (dired-do-find-regexp-and-replace) fails when
> user has deleted a directory in the same Emacs session.

Thanks for the report, should be fixed now in emacs-26.





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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-25 22:43       ` Dmitry Gutov
@ 2017-09-26  3:28         ` John Wiegley
  2017-09-26  8:19           ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: John Wiegley @ 2017-09-26  3:28 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Teemu Likonen, 28575

>>>>> Dmitry Gutov <dgutov@yandex.ru> writes:

> Thanks, but that's odd, I've managed to reproduce it fine. Fix incoming.

I wonder if being on macOS changed anything.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2





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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-26  3:28         ` John Wiegley
@ 2017-09-26  8:19           ` Dmitry Gutov
  2017-09-26 16:27             ` John Wiegley
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2017-09-26  8:19 UTC (permalink / raw)
  To: John Wiegley; +Cc: Teemu Likonen, 28575

On 9/26/17 6:28 AM, John Wiegley wrote:

> I wonder if being on macOS changed anything.

Try this, maybe:

(let ((default-directory "/fooo")) (shell-command-to-string "ls /"))

It should simulate the problem.





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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-26  8:19           ` Dmitry Gutov
@ 2017-09-26 16:27             ` John Wiegley
  2017-09-26 18:59               ` Dmitry Gutov
  0 siblings, 1 reply; 10+ messages in thread
From: John Wiegley @ 2017-09-26 16:27 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Teemu Likonen, 28575

>>>>> Dmitry Gutov <dgutov@yandex.ru> writes:

> Try this, maybe:
> (let ((default-directory "/fooo")) (shell-command-to-string "ls /"))
> It should simulate the problem.

I get:

    apply: Setting current directory: No such file or directory, /fooo

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2





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

* bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory
  2017-09-26 16:27             ` John Wiegley
@ 2017-09-26 18:59               ` Dmitry Gutov
  0 siblings, 0 replies; 10+ messages in thread
From: Dmitry Gutov @ 2017-09-26 18:59 UTC (permalink / raw)
  To: John Wiegley; +Cc: Teemu Likonen, 28575

On 9/26/17 7:27 PM, John Wiegley wrote:

> I get:
> 
>      apply: Setting current directory: No such file or directory, /fooo

Same here. In the case of this report, the old default-directory value 
was captured in the temporary buffer (which is reused between 
xref-collect-matches calls).

Not sure why you couldn't reproduce that.





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

end of thread, other threads:[~2017-09-26 18:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-24 13:10 bug#28575: 25.1; dired-do-find-regexp-and-replace error about previously deleted directory Teemu Likonen
2017-09-24 23:11 ` John Wiegley
2017-09-25  3:29   ` Teemu Likonen
2017-09-25  4:28     ` John Wiegley
2017-09-25 22:43       ` Dmitry Gutov
2017-09-26  3:28         ` John Wiegley
2017-09-26  8:19           ` Dmitry Gutov
2017-09-26 16:27             ` John Wiegley
2017-09-26 18:59               ` Dmitry Gutov
2017-09-25 22:48 ` Dmitry Gutov

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).