aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2013-07-03 11:01:34 +0800
committerLeo Liu2013-07-03 11:01:34 +0800
commite01aa29cd90dc51ecb9b8c4ec6164fb748a6b892 (patch)
treeed1d808c79b6b2484df9be6d7aa2605481c3bb8c
parent3086ca2e2cf739cc7fd667b16c676522aecf4112 (diff)
downloademacs-e01aa29cd90dc51ecb9b8c4ec6164fb748a6b892.tar.gz
emacs-e01aa29cd90dc51ecb9b8c4ec6164fb748a6b892.zip
* ido.el (ido-delete-file-at-head): Respect delete-by-moving-to-trash.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/ido.el6
2 files changed, 8 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9a5af5e31d2..f717fdcc4e4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12013-07-03 Leo Liu <sdl.web@gmail.com>
2
3 * ido.el (ido-delete-file-at-head): Respect delete-by-moving-to-trash.
4
12013-07-03 Dmitry Gutov <dgutov@yandex.ru> 52013-07-03 Dmitry Gutov <dgutov@yandex.ru>
2 6
3 * progmodes/ruby-mode.el (ruby-move-to-block): When we're at a 7 * progmodes/ruby-mode.el (ruby-move-to-block): When we're at a
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."
3986;;; DELETE CURRENT FILE 3986;;; DELETE CURRENT FILE
3987(defun ido-delete-file-at-head () 3987(defun ido-delete-file-at-head ()
3988 "Delete the file at the head of `ido-matches'. 3988 "Delete the file at the head of `ido-matches'.
3989Trash the file if `delete-by-moving-to-trash' is non-nil.
3989If cursor is not at the end of the user input, delete to end of input." 3990If cursor is not at the end of the user input, delete to end of input."
3990 (interactive) 3991 (interactive)
3991 (if (not (eobp)) 3992 (if (not (eobp))
@@ -3998,8 +3999,9 @@ If cursor is not at the end of the user input, delete to end of input."
3998 (file-exists-p file) 3999 (file-exists-p file)
3999 (not (file-directory-p file)) 4000 (not (file-directory-p file))
4000 (file-writable-p ido-current-directory) 4001 (file-writable-p ido-current-directory)
4001 (yes-or-no-p (concat "Delete " file "? "))) 4002 (or delete-by-moving-to-trash
4002 (delete-file file) 4003 (yes-or-no-p (concat "Delete " file "? "))))
4004 (delete-file file 'trash)
4003 ;; Check if file still exists. 4005 ;; Check if file still exists.
4004 (if (file-exists-p file) 4006 (if (file-exists-p file)
4005 ;; file could not be deleted 4007 ;; file could not be deleted