Skip to content

Instantly share code, notes, and snippets.

@malcook
Created June 26, 2012 20:18
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 malcook/2998639 to your computer and use it in GitHub Desktop.
Save malcook/2998639 to your computer and use it in GitHub Desktop.
Allows more aggressive control over recursive deletion policy
(defadvice dired-do-flagged-delete
(around dired-do-flagged-delete activate)
"Allows more aggressive control over recursive deletion policy:
`dired-recursive-deletes` is set based on the current-prefix-arg:
4=>top (with confirmation)
16=>always (with confirmation)
64=>always (without confirmation)"
(interactive "p")
(let ((dired-recursive-deletes (case (car current-prefix-arg)
(4 'top)
(16 'always)
(64 'always)
(t dired-recursive-deletes))))
(if (or (null dired-recursive-deletes)
(eq 64 dired-recursive-deletes)
(y-or-n-p (format "Delete with dired-recursive-deletes = %s" dired-recursive-deletes)))
ad-do-it
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment