Subject: Re: bug#58721: 28.2; dired with delete-by-moving-to-trash can't trash directory twice

From: Eli Zaretskii <[email-masked]>
Date: Thu, 27 Oct 2022 22:04:29 +0300

> From: Gustavo Barros <[email-masked]>
> Date: Thu, 27 Oct 2022 15:41:43 -0300
> Cc: [email-masked]
> 
> > [...] so why does
> > only the second move to trash cause the error?
> 
> As far as I can tell, the existence of
> "~/.local/share/Trash/files/org-mode" triggers it. I'd presume that
> its existence takes the execution path to some code branch (the one
> which tries to uniquify the file name/calls make-temp-file) which
> tries to somehow create the directory twice.

Perhaps step in Edebug through copy-directory, and see what's going on
there?  AFAIU, the problem happens inside that function.