summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2013-07-03 11:01:34 +0800
committerLeo Liu <sdl.web@gmail.com>2013-07-03 11:01:34 +0800
commite01aa29cd90dc51ecb9b8c4ec6164fb748a6b892 (patch)
treeed1d808c79b6b2484df9be6d7aa2605481c3bb8c /lisp/ido.el
parent3086ca2e2cf739cc7fd667b16c676522aecf4112 (diff)
downloademacs-e01aa29cd90dc51ecb9b8c4ec6164fb748a6b892.tar.gz
* ido.el (ido-delete-file-at-head): Respect delete-by-moving-to-trash.
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index 4a4ecdcdb1a..bfa515ba26c 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3986,6 +3986,7 @@ If cursor is not at the end of the user input, delete to end of input."
;;; DELETE CURRENT FILE
(defun ido-delete-file-at-head ()
"Delete the file at the head of `ido-matches'.
+Trash the file if `delete-by-moving-to-trash' is non-nil.
If cursor is not at the end of the user input, delete to end of input."
(interactive)
(if (not (eobp))
@@ -3998,8 +3999,9 @@ If cursor is not at the end of the user input, delete to end of input."
(file-exists-p file)
(not (file-directory-p file))
(file-writable-p ido-current-directory)
- (yes-or-no-p (concat "Delete " file "? ")))
- (delete-file file)
+ (or delete-by-moving-to-trash
+ (yes-or-no-p (concat "Delete " file "? "))))
+ (delete-file file 'trash)
;; Check if file still exists.
(if (file-exists-p file)
;; file could not be deleted