From 4aefb5b5964e1aaad0c74238e14ad0a1e3dc4e7a Mon Sep 17 00:00:00 2001 From: Mike Kupfer Date: Sun, 20 Nov 2022 16:44:20 -0800 Subject: [PATCH 2/2] Fix trashing of symlink that points at a directory * lisp/files.el (move-file-to-trash): Redefine is-directory so that it is false for symlinks. --- lisp/files.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/files.el b/lisp/files.el index de4f68ebd51..a78d1627689 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -8566,7 +8566,8 @@ move-file-to-trash ;; Make a .trashinfo file. Use O_EXCL, as per trash-spec 1.0. (let* ((files-base (file-name-nondirectory fn)) - (is-directory (file-directory-p fn)) + (is-directory (and (file-directory-p fn) + (not (file-symlink-p fn)))) (overwrite nil) info-fn) ;; We're checking further down whether the info file -- 2.30.2