GNU bug report logs - #47960
28.0.50; delete-by-moving-to-trash fails on directories?

Previous Next

Package: emacs;

Reported by: Protesilaos Stavrou <info <at> protesilaos.com>

Date: Thu, 22 Apr 2021 20:49:01 UTC

Severity: normal

Tags: fixed, patch

Merged with 48280

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 47960 <at> debbugs.gnu.org
Subject: bug#47960: 28.0.50; delete-by-moving-to-trash fails on directories?
Date: Fri, 23 Apr 2021 00:42:00 +0300
On 2021-04-22, 21:11 +0000, Gregory Heytings <gregory <at> heytings.org> wrote:

>>
>> On trunk the (setq delete-by-moving-to-trash t) no longer works in
>> Dired and Eshell when trying to delete a directory.
>>
>> Steps to reproduce with emacs -Q:
>>
>> + Evaluate (setq delete-by-moving-to-trash t).
>> + Use 'C-x C-j' to jump to a dired buffer.
>> + Then type '+' and create a new directory named "test" or whatever.
>> + With point over the newly created directory ,type "D", and confirm.
>>
>> You get an error: "file-error: Renaming: Not a directory [...]"
>>
>> Same if you try to delete the directory with the 'rm -r' command from
>> inside eshell (though 'rmdir' works in this case).
>>
>> For completeness, M-x shell works with either 'rm -r' and 'rmdir'.
>>
>
> Are you sure this bug is not due to something going wrong on your
> machine? I'm unable to reproduce this bug here, both Dired and Eshell
> seem to work as expected.

It could be, though I have only updated Emacs in the last ~10 days.

What seems to be the issue is when a deleted entry of the same name
already exists.  I emptied my trash and tried the above recipe: the
problem would not occur.  But upon immediate retry the problem appeared,
presumably because "test" already existed in the trash.

> Did you by any chance define a 'system-move-file-to-trash' function?

No

> Does it work when you (setq trash-directory <something>)?

Yes, it does.  Both for my original recipe and with the other case I
mentioned above.

I have always set this to nil, which makes it use the trash of
freedesktop.org.

-- 
Protesilaos Stavrou
https://protesilaos.com




This bug report was last modified 4 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.