Subject: bug#59986: 30.0.50; Can't trash file with broken symbolic link

From: Michael Heerdegen <[email-masked]>
Date: Thu, 15 Dec 2022 01:13:04 +0100

Eli Zaretskii <[email-masked]> writes:

> Meaning that you don't remember whether the file which was already in
> Trash in bug#47135 was or wasn't a symlink?

AFAIU it had been - the original report says:

| In my trash there is this file:
|
|   lrwxrwxrwx 1  175 Jun 18  2019 Rock-and-Mineral-Identification.pdf -> /home/...

I think there is indeed a problem with those `file-exists-p' tests in
`move-file-to-trash' that check whether the file name to add (in the
trash) already exists: when that name is the existing name of a broken
symlink the result is `nil'.

Those tests probably need to handle symlinks specially (using
file-symlink-p I guess).

Michael.