From f1e793405db2055c78944fe4001d60d3cf0bbbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ellis=20Keny=C5=91?= Date: Sun, 18 Sep 2022 06:46:17 +0100 Subject: [PATCH] fix(macos): only use trash on local hosts Fix: #6804 --- modules/os/macos/config.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/os/macos/config.el b/modules/os/macos/config.el index ad91aa0f7..0644a1e0b 100644 --- a/modules/os/macos/config.el +++ b/modules/os/macos/config.el @@ -45,6 +45,9 @@ (setq delete-by-moving-to-trash t) ;; Lazy load `osx-trash' - (and IS-MAC - (not (fboundp 'system-move-file-to-trash)) - (defalias #'system-move-file-to-trash #'osx-trash-move-file-to-trash))) + (when (not (fboundp 'system-move-file-to-trash)) + (defun system-move-file-to-trash (file) + "Move FILE to trash." + (when (and (not IS-LINUX) + (not (file-remote-p default-directory))) + (osx-trash-move-file-to-trash file)))))