diff options
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/ido.el | 6 |
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 @@ | |||
| 1 | 2013-07-03 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * ido.el (ido-delete-file-at-head): Respect delete-by-moving-to-trash. | ||
| 4 | |||
| 1 | 2013-07-03 Dmitry Gutov <dgutov@yandex.ru> | 5 | 2013-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'. |
| 3989 | Trash the file if `delete-by-moving-to-trash' is non-nil. | ||
| 3989 | If cursor is not at the end of the user input, delete to end of input." | 3990 | If 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 |