]> code.delx.au - gnu-emacs/blobdiff - lisp/x-dnd.el
Merge from mainline.
[gnu-emacs] / lisp / x-dnd.el
index fc593224d24b5d544e7499e8c68edbaa4c72722e..328eb569c6f39ad8cbb54961b03f5fdf068e4000 100644 (file)
@@ -1,6 +1,6 @@
 ;;; x-dnd.el --- drag and drop support for X.
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
@@ -79,6 +79,7 @@ if drop is successful, nil if not."
   :group 'x)
 
 (defcustom x-dnd-known-types
+  (mapcar 'purecopy
   '("text/uri-list"
     "text/x-moz-url"
     "_NETSCAPE_URL"
@@ -91,7 +92,7 @@ if drop is successful, nil if not."
     "COMPOUND_TEXT"
     "STRING"
     "TEXT"
-    )
+    ))
   "The types accepted by default for dropped data.
 The types are chosen in the order they appear in the list."
   :version "22.1"
@@ -174,10 +175,10 @@ action and type we got from `x-dnd-test-function'."
   (let ((buffer (when (window-live-p window)
                  (window-buffer window)))
        (current-state (x-dnd-get-state-for-frame window)))
-    (when (or (not (equal buffer (aref current-state 0)))
-             (not (equal window (aref current-state 1)))
-             (not (equal action (aref current-state 3))))
-      (save-excursion
+    (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 x-dnd-test-function
                                     window