Skip to content

Commit

Permalink
Add deletion command du-delete
Browse files Browse the repository at this point in the history
  • Loading branch information
pft committed Jan 16, 2010
1 parent ae86003 commit 73ec70e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions disk-usage.el
Expand Up @@ -291,6 +291,21 @@ See man(du) for explanation of those arguments"
(= (point-min)
(point-max)))

(defun du-delete ()
"Directly delete a file or directory in Disk Usage buffer.
To keep it simple, this command does not delete the file or directory from the buffer."
(interactive)
(let* ((file-or-dir (du-file-at-line))
(type (if (file-directory-p file-or-dir)
'dir
'file)))
(when (yes-or-no-p
(format "Delete %S? " type))
(case type
(file (delete-file file-or-dir))
(dir (delete-directory file-or-dir t))))))

(define-minor-mode du-mode
"Minor mode for du.
Expand Down

0 comments on commit 73ec70e

Please sign in to comment.