Permalink
Browse files

* disk-usage.el: Save pos to get back at.

  • Loading branch information...
pft committed Mar 28, 2012
1 parent c319257 commit bd270f49d64424a7fe4a54ca477c1ebc9068c545
Showing with 6 additions and 2 deletions.
  1. +6 −2 disk-usage.el
View
@@ -296,15 +296,19 @@ See man(du) for explanation of those arguments"
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))
+ (let* ((pos (point))
+ (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))))))
+ (dir (delete-directory file-or-dir t)))
+ (goto-char pos)
+ (let (buffer-read-only)
+ (delete-region (point-at-bol) (point-at-bol 2))))))
(define-minor-mode du-mode
"Minor mode for du.

0 comments on commit bd270f4

Please sign in to comment.