Skip to content

Instantly share code, notes, and snippets.

@hyagni
Created February 26, 2011 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyagni/845213 to your computer and use it in GitHub Desktop.
Save hyagni/845213 to your computer and use it in GitHub Desktop.
On Ubuntu, use trash instead of rm/rmdir. trash is part of trash-cli.
;; use trash for remove files
(defun my-trash-file (FILENAME)
(call-process-shell-command (concat "trash " FILENAME)
nil 0))
;; call-process-shell-command doesnt wait, with BUFFER 0
(defalias 'delete-file 'my-trash-file)
(defalias 'delete-directory 'my-trash-file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment