emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113266: * ido.el (ido-delete-file-at-head): Respect


From: Leo Liu
Subject: [Emacs-diffs] trunk r113266: * ido.el (ido-delete-file-at-head): Respect delete-by-moving-to-trash.
Date: Wed, 03 Jul 2013 03:02:23 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113266
revision-id: address@hidden
parent: address@hidden
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Wed 2013-07-03 11:01:34 +0800
message:
  * ido.el (ido-delete-file-at-head): Respect delete-by-moving-to-trash.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/ido.el                    ido.el-20091113204419-o5vbwnq5f7feedwu-2430
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-07-03 01:02:18 +0000
+++ b/lisp/ChangeLog    2013-07-03 03:01:34 +0000
@@ -1,3 +1,7 @@
+2013-07-03  Leo Liu  <address@hidden>
+
+       * ido.el (ido-delete-file-at-head): Respect delete-by-moving-to-trash.
+
 2013-07-03  Dmitry Gutov  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-move-to-block): When we're at a

=== modified file 'lisp/ido.el'
--- a/lisp/ido.el       2013-06-25 01:04:06 +0000
+++ b/lisp/ido.el       2013-07-03 03:01:34 +0000
@@ -3986,6 +3986,7 @@
 ;;; 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 @@
                 (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]