summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2016-08-12 15:55:04 +0200
committerAlan Pearce2016-08-12 15:55:04 +0200
commit89a9b4c1ee8ec9fd76e3ee559da6bc81c2bb315e (patch)
treebdf872173f30af8eb90d923399d48ff538c242ea /tag-emacs
parentd5c79a6dfb57d24523ce0aaeb2e17b26cf07d963 (diff)
downloaddotfiles-89a9b4c1ee8ec9fd76e3ee559da6bc81c2bb315e.tar.lz
dotfiles-89a9b4c1ee8ec9fd76e3ee559da6bc81c2bb315e.tar.zst
dotfiles-89a9b4c1ee8ec9fd76e3ee559da6bc81c2bb315e.zip
Emacs: Delete to trash correctly on OSX
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.org7
1 files changed, 6 insertions, 1 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 4031763..a89a4c5 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -518,7 +518,12 @@ trash for deleting on OS X.
           backup-by-copying-when-linked t
           backup-by-copying-when-mismatch t))
   (if (eq system-type 'darwin)
-      (setq delete-by-moving-to-trash t))
+      (setq delete-by-moving-to-trash t)
+    (if (and (executable-find "trash") (not (fboundp #'system-move-file-to-trash)))
+        (defun system-move-file-to-trash (file)
+          (call-process (executable-find "trash")
+                        nil 0 nil
+                        file))))
 #+END_SRC
 
 ** autorevert