[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/dired.el,v
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/dired.el,v |
Date: |
Sun, 06 Apr 2008 20:58:20 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Chong Yidong <cyd> 08/04/06 20:58:20
Index: dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/dired.el,v
retrieving revision 1.384
retrieving revision 1.385
diff -u -b -r1.384 -r1.385
--- dired.el 6 Apr 2008 20:37:01 -0000 1.384
+++ dired.el 6 Apr 2008 20:58:20 -0000 1.385
@@ -3281,25 +3281,28 @@
Ask means pop up a menu for the user to select one of copy, move or link."
(require 'dired-aux)
(let* ((from (dnd-get-local-file-name uri t))
- (to (if from (concat (dired-current-directory)
- (file-name-nondirectory from))
- nil)))
+ (to (when from
+ (concat (dired-current-directory)
+ (file-name-nondirectory from)))))
(when from
- (cond ((or (eq action 'copy)
- (eq action 'private)) ; Treat private as copy.
- ;; If copying a directory and dired-recursive-copies is nil,
- ;; dired-copy-file silently fails. Pop up a notice.
- (cond ((and (file-directory-p from)
+ (cond ((eq action 'ask)
+ (dired-dnd-do-ask-action uri))
+ ;; If copying a directory and dired-recursive-copies is
+ ;; nil, dired-copy-file fails. Pop up a notice.
+ ((and (memq action '(copy private))
+ (file-directory-p from)
(not dired-recursive-copies))
(dired-dnd-popup-notice))
- ((file-exists-p to)
- (let ((overwrite
- (y-or-n-p (format "Overwrite existing file `%s'? "
to)))
- ;; We avoid dired-handle-overwrite and use
+ ((memq action '(copy private move link))
+ (let ((overwrite (and (file-exists-p to)
+ (y-or-n-p
+ (format "Overwrite existing file `%s'? "
to))))
+ ;; Binding dired-overwrite-confirmed to nil makes
+ ;; dired-handle-overwrite a no-op. We instead use
;; y-or-n-p, which pops a graphical menu.
dired-overwrite-confirmed backup-file)
(when (and overwrite
- ;; silence compiler
+ ;; d-b-o is defined in dired-aux.
(boundp 'dired-backup-overwrite)
dired-backup-overwrite
(setq backup-file
@@ -3310,26 +3313,14 @@
"Make backup for existing file `%s'? "
to))))
(rename-file to backup-file 0)
(dired-relist-entry backup-file))
- (dired-copy-file from to overwrite)))
- (t
- (let (dired-overwrite-confirmed)
- (dired-copy-file from to nil))))
- (dired-relist-entry to)
- action)
+ (cond ((memq action '(copy private))
+ (dired-copy-file from to overwrite))
((eq action 'move)
- (dired-rename-file from to 1)
- (dired-relist-entry to)
- action)
-
+ (dired-rename-file from to overwrite))
((eq action 'link)
- (make-symbolic-link from to 1)
+ (make-symbolic-link from to overwrite)))
(dired-relist-entry to)
- action)
-
- ((eq action 'ask)
- (dired-dnd-do-ask-action uri))
-
- (t nil)))))
+ action))))))
(defun dired-dnd-handle-file (uri action)
"Copy, move or link a file to the dired directory if it is a local file.
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Miles Bader, 2008/04/05
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Chong Yidong, 2008/04/06
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Chong Yidong, 2008/04/06
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Chong Yidong, 2008/04/06
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v,
Chong Yidong <=
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Stefan Monnier, 2008/04/11
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Miles Bader, 2008/04/17
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Dan Nicolaescu, 2008/04/27
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Stefan Monnier, 2008/04/29
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Stefan Monnier, 2008/04/29
- [Emacs-diffs] Changes to emacs/lisp/dired.el,v, Dan Nicolaescu, 2008/04/30