GNU bug report logs - #58721
28.2; dired with delete-by-moving-to-trash can't trash directory twice

Previous Next

Package: emacs;

Reported by: Gustavo Barros <gusbrs.2016 <at> gmail.com>

Date: Sat, 22 Oct 2022 18:24:01 UTC

Severity: normal

Found in version 28.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gustavo Barros <gusbrs.2016 <at> gmail.com>
To: Mike Kupfer <mkupfer <at> alum.berkeley.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58721 <at> debbugs.gnu.org
Subject: bug#58721: 28.2; dired with delete-by-moving-to-trash can't trash directory twice
Date: Sun, 30 Oct 2022 20:10:04 -0300
On Sun, 30 Oct 2022 at 19:20, Mike Kupfer <mkupfer <at> alum.berkeley.edu> wrote:

> Well, it turns out I hadn't tested my previous patch enough.  It handled
> the first deletion of directory foo, but not subsequent deletions (which
> was the entire point of the fix, sigh).  I've attached another patch.
> I took a stab at improving the commenting in the code while I was
> there.

I may be wrong but, as far as my reading goes, I think this might
misbehave if the "directory" is a symlink. `is-directory' is built as
`(file-directory-p fn)' which returns t even if it is a symlink to a
directory. Would things such as `copy-directory` (with `copy-contents`
arg t) and `delete-directory' work just as well in such a case?

Besides that, in general, imho I cannot think of this issue as
something else other than a misbehavior of `rename-file', so that the
patch in these terms feels like a workaround. I understand Eli
disagrees. True, most likely this is just a muggle (me) being naive,
so I'll try to watch and learn.




This bug report was last modified 2 years and 182 days ago.

Previous Next


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