]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
trash on osx
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 9 May 2017 14:05:19 +0000 (16:05 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 9 May 2017 14:05:19 +0000 (16:05 +0200)
* use osx trash to delete files.

Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
bba.org

diff --git a/bba.org b/bba.org
index 650fa882294b8a75f84e91c158c41078624517d8..77c8f103702906c81ed8e3b43b07c98365a23aee 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -154,6 +154,28 @@ from bash.
       )
 #+END_SRC
 
+* move files to trash on osx
+[2017-02-10 Fri 15:12]
+
+If trash is missing you might want to run
+
+=sudo port install trash=
+
+#+BEGIN_SRC emacs-lisp :tangle yes
+  (if (string-equal system-type "darwin")
+  (if (file-exists-p "/opt/local/bin/trash")
+      (progn
+       (defun system-move-file-to-trash (file)
+      "Use osx port trash to move files to trash"
+      (call-process "trash" nil nil nil file)
+       )
+      )
+  )
+  )
+#+END_SRC
+
+With trash you can recover files to it's original location.
+
 * eshell and shell environment
 
 We don't need a =$PAGER= in Emacs: