Permalink
Browse files
* disk-usage.el: Save pos to get back at.
- Loading branch information...
Showing
with
6 additions
and
2 deletions.
-
+6
−2
disk-usage.el
|
@@ -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