diff --git a/lisp/files.el b/lisp/files.el index 1e11dd44bad..447661dba5b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -8812,9 +8812,10 @@ move-file-to-trash ;; 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 + ((connection-local-value trash-directory) ;; If `trash-directory' is non-nil, move the file there. - (let* ((trash-dir (expand-file-name trash-directory)) + (let* ((trash-dir (expand-file-name + (connection-local-value trash-directory))) (fn (directory-file-name (expand-file-name filename))) (new-fn (concat (file-name-as-directory trash-dir) (file-name-nondirectory fn))))