Function: pgtk-dnd-maybe-call-test-function
pgtk-dnd-maybe-call-test-function is a byte-compiled function defined
in pgtk-dnd.el.gz.
Signature
(pgtk-dnd-maybe-call-test-function WINDOW ACTION)
Documentation
Call pgtk-dnd-test-function if something has changed.
WINDOW is the window the mouse is over. ACTION is the suggested
action from the source. If nothing has changed, return the last
action and type we got from pgtk-dnd-test-function.
Source Code
;; Defined in /usr/src/emacs/lisp/pgtk-dnd.el.gz
(defun pgtk-dnd-maybe-call-test-function (window action)
"Call `pgtk-dnd-test-function' if something has changed.
WINDOW is the window the mouse is over. ACTION is the suggested
action from the source. If nothing has changed, return the last
action and type we got from `pgtk-dnd-test-function'."
(let ((buffer (when (window-live-p window)
(window-buffer window)))
(current-state (pgtk-dnd-get-state-for-frame window)))
(unless (and (equal buffer (aref current-state 0))
(equal window (aref current-state 1))
(equal action (aref current-state 3)))
(save-current-buffer
(when buffer (set-buffer buffer))
(let* ((action-type (funcall pgtk-dnd-test-function
window
action
(aref current-state 2)))
(handler (cdr (assoc (cdr action-type) pgtk-dnd-types-alist))))
;; Ignore action-type if we have no handler.
(setq current-state
(pgtk-dnd-save-state window
action
(when handler action-type)))))))
(let ((current-state (pgtk-dnd-get-state-for-frame window)))
(cons (aref current-state 5)
(aref current-state 4))))