Function: x-dnd-drop-data
x-dnd-drop-data is a byte-compiled function defined in x-dnd.el.gz.
Signature
(x-dnd-drop-data EVENT FRAME WINDOW DATA TYPE)
Documentation
Drop one data item onto a frame.
EVENT is the client message for the drop, FRAME is the frame the drop
occurred on. WINDOW is the window of FRAME where the drop happened.
DATA is the data received from the source, and type is the type for DATA,
see x-dnd-types-alist).
Returns the action used (move, copy, link, private) if drop was successful, nil if not.
Source Code
;; Defined in /usr/src/emacs/lisp/x-dnd.el.gz
(defun x-dnd-drop-data (event frame window data type)
"Drop one data item onto a frame.
EVENT is the client message for the drop, FRAME is the frame the drop
occurred on. WINDOW is the window of FRAME where the drop happened.
DATA is the data received from the source, and type is the type for DATA,
see `x-dnd-types-alist').
Returns the action used (move, copy, link, private) if drop was successful,
nil if not."
(let* ((type-info (assoc type x-dnd-types-alist))
(handler (cdr type-info))
(state (x-dnd-get-state-for-frame frame))
(action (aref state 5))
(w (posn-window (event-start event))))
(when handler
(if (and (window-live-p w)
(not (window-minibuffer-p w))
(not (window-dedicated-p w)))
;; If dropping in an ordinary window which we could use,
;; let dnd-open-file-other-window specify what to do.
(progn
(when (and (not mouse-yank-at-point)
;; If dropping on top of the mode line, insert
;; the text at point instead.
(posn-point (event-start event)))
(goto-char (posn-point (event-start event))))
(funcall handler window action data))
;; If we can't display the file here,
;; make a new window for it.
(let ((dnd-open-file-other-window t))
(select-frame frame)
(funcall handler window action data))))))