help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired cons bug?


From: Harald Judt
Subject: Re: dired cons bug?
Date: Thu, 11 Aug 2022 11:23:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

Am 10.08.22 um 13:26 schrieb Harald Judt:
Hi,

I have a question regarding using dired programmatically in Emacs 28.1. Say I
do the following call to open a dired buffer and insert the files:

(dired (cons "/home/user" '("/home/user/tmp/test/a/a" "/home/user/tmp/test/b/b" "/home/user/tmp/test/c/c")))

It works fine, I get a nice listing and can move around like expected, mark
files and try to delete them. Now it gets interesting: Usually after hitting
"x" to execute, then confirming the deletion, the buffer will refresh. But not
in this case, not when I open dired using the cons above. I can revert the
buffer using "g".

Note that when I simply do (dired "/home/user/tmp/test"), then insert the
subdir to show the files and delete them, this is not reproducible. The buffer
will be refreshed immediately after the delete operation completes.

Why? Am I missing something? Is this a (known) bug or expected behaviour? I've
tried with emacs -Q, so it seems to be no configuration problem.

Regards,
Harald

I have found an explanation for my own question: The problem is that after a dired-do-xxxx command, the buffer of the _target_ directory will be refreshed. But the target directory of /home/user/tmp/test/a/a would be /home/user/tmp/test/a/, and that is different from the one used in the base dir of the cons (/home/user/). In fact, if I add a file /home/user/x and add that to the file list and delete it, the buffer will be reverted correctly. If I delete any of the other files, it won't.

Now, what could I do to programmatically revert the current dired buffer after executing a dired-do command?

Harald

--
`Experience is the best teacher.'

PGP Key ID: 4FFFAB21B8580ABD
Fingerprint: E073 6DD8 FF40 9CF2 0665 11D4 4FFF AB21 B858 0ABD

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]