From: Mike Kupfer Date: Mon, 21 Nov 2022 00:44:20 +0000 (-0800) Subject: Fix trashing of symlink that points at a directory X-Git-Tag: emacs-29.0.90~1541 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=867e962cf5318399dfc17cc53c661db4bbd3c3d1;p=emacs.git 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. --- diff --git a/lisp/files.el b/lisp/files.el index 127cf77240f..60c0eb917e5 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -8566,7 +8566,8 @@ Otherwise, trash FILENAME using the freedesktop.org conventions, ;; 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