aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2005-04-11 19:28:07 +0000
committerJan Djärv2005-04-11 19:28:07 +0000
commit361eee8f580c6e48db0a64aebdd094379df032f0 (patch)
treeac56e29bdff4908ea3d71206cb9b8f2a7cd85bdf
parent6bc52abcc6f560d0085ebd4d1e1409b2c87e664b (diff)
downloademacs-361eee8f580c6e48db0a64aebdd094379df032f0.tar.gz
emacs-361eee8f580c6e48db0a64aebdd094379df032f0.zip
* dired.el (dired-mode): Use dnd-* instead of x-dnd-*
(dired-dnd-handle-local-file): Call dnd-get-local-file-name. (dired-dnd-handle-file): Call dnd-get-local-file-uri
-rw-r--r--lisp/dired.el26
1 files changed, 6 insertions, 20 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index d709b9f89e8..474b4f3d9b5 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1523,15 +1523,13 @@ Keybindings:
1523 (setq dired-switches-alist nil) 1523 (setq dired-switches-alist nil)
1524 (dired-sort-other dired-actual-switches t) 1524 (dired-sort-other dired-actual-switches t)
1525 (run-mode-hooks 'dired-mode-hook) 1525 (run-mode-hooks 'dired-mode-hook)
1526 (when (featurep 'x-dnd) 1526 (when (featurep 'dnd)
1527 (make-variable-buffer-local 'x-dnd-test-function) 1527 (make-variable-buffer-local 'dnd-protocol-alist)
1528 (make-variable-buffer-local 'x-dnd-protocol-alist) 1528 (setq dnd-protocol-alist
1529 (setq x-dnd-test-function 'dired-dnd-test-function)
1530 (setq x-dnd-protocol-alist
1531 (append '(("^file:///" . dired-dnd-handle-local-file) 1529 (append '(("^file:///" . dired-dnd-handle-local-file)
1532 ("^file://" . dired-dnd-handle-file) 1530 ("^file://" . dired-dnd-handle-file)
1533 ("^file:" . dired-dnd-handle-local-file)) 1531 ("^file:" . dired-dnd-handle-local-file))
1534 x-dnd-protocol-alist)))) 1532 dnd-protocol-alist))))
1535 1533
1536;; Idiosyncratic dired commands that don't deal with marks. 1534;; Idiosyncratic dired commands that don't deal with marks.
1537 1535
@@ -3136,18 +3134,6 @@ Anything else means ask for each directory."
3136 (const :tag "Copy directories without asking" always)) 3134 (const :tag "Copy directories without asking" always))
3137 :group 'dired) 3135 :group 'dired)
3138 3136
3139(defun dired-dnd-test-function (window action types)
3140 "The test function for drag and drop into dired buffers.
3141WINDOW is where the mouse is when this function is called. It may be a frame
3142if the mouse is over the menu bar, scroll bar or tool bar.
3143ACTION is the suggested action from the source, and TYPES are the
3144types the drop data can have. This function only accepts drops with
3145types in `x-dnd-known-types'. It returns the action suggested by the source."
3146 (let ((type (x-dnd-choose-type types)))
3147 (if type
3148 (cons action type)
3149 nil)))
3150
3151(defun dired-dnd-popup-notice () 3137(defun dired-dnd-popup-notice ()
3152 (x-popup-dialog 3138 (x-popup-dialog
3153 t 3139 t
@@ -3176,7 +3162,7 @@ types in `x-dnd-known-types'. It returns the action suggested by the source."
3176URI is the file to handle, ACTION is one of copy, move, link or ask. 3162URI is the file to handle, ACTION is one of copy, move, link or ask.
3177Ask means pop up a menu for the user to select one of copy, move or link." 3163Ask means pop up a menu for the user to select one of copy, move or link."
3178 (require 'dired-aux) 3164 (require 'dired-aux)
3179 (let* ((from (x-dnd-get-local-file-name uri t)) 3165 (let* ((from (dnd-get-local-file-name uri t))
3180 (to (if from (concat (dired-current-directory) 3166 (to (if from (concat (dired-current-directory)
3181 (file-name-nondirectory from)) 3167 (file-name-nondirectory from))
3182 nil))) 3168 nil)))
@@ -3214,7 +3200,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3214URI is the file to handle. If the hostname in the URI isn't local, do nothing. 3200URI is the file to handle. If the hostname in the URI isn't local, do nothing.
3215ACTION is one of copy, move, link or ask. 3201ACTION is one of copy, move, link or ask.
3216Ask means pop up a menu for the user to select one of copy, move or link." 3202Ask means pop up a menu for the user to select one of copy, move or link."
3217 (let ((local-file (x-dnd-get-local-file-uri uri))) 3203 (let ((local-file (dnd-get-local-file-uri uri)))
3218 (if local-file (dired-dnd-handle-local-file local-file action) 3204 (if local-file (dired-dnd-handle-local-file local-file action)
3219 nil))) 3205 nil)))
3220 3206