mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
Make 'move-file-to-trash' behave according to the documentation
* lisp/files.el (move-file-to-trash): Behave like the doc string says: check whether 'system-move-file-to-trash' is defined before testing that 'trash-directory' is non-nil. (Bug#33335)
This commit is contained in:
parent
663613a1c0
commit
1a3d471d87
1 changed files with 4 additions and 4 deletions
|
|
@ -7393,7 +7393,10 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
|
|||
like the GNOME, KDE and XFCE desktop environments. Emacs only
|
||||
moves files to \"home trash\", ignoring per-volume trashcans."
|
||||
(interactive "fMove file to trash: ")
|
||||
(cond (trash-directory
|
||||
;; If `system-move-file-to-trash' is defined, use it.
|
||||
(cond ((fboundp 'system-move-file-to-trash)
|
||||
(system-move-file-to-trash filename))
|
||||
(trash-directory
|
||||
;; If `trash-directory' is non-nil, move the file there.
|
||||
(let* ((trash-dir (expand-file-name trash-directory))
|
||||
(fn (directory-file-name (expand-file-name filename)))
|
||||
|
|
@ -7412,9 +7415,6 @@ Otherwise, trash FILENAME using the freedesktop.org conventions,
|
|||
(setq new-fn (car (find-backup-file-name new-fn)))))
|
||||
(let (delete-by-moving-to-trash)
|
||||
(rename-file fn new-fn))))
|
||||
;; If `system-move-file-to-trash' is defined, use it.
|
||||
((fboundp 'system-move-file-to-trash)
|
||||
(system-move-file-to-trash filename))
|
||||
;; Otherwise, use the freedesktop.org method, as specified at
|
||||
;; http://freedesktop.org/wiki/Specifications/trash-spec
|
||||
(t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue