]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #6689 with mouse-2 pasting on Windows.
authorEli Zaretskii <eliz@gnu.org>
Sat, 14 Aug 2010 15:41:22 +0000 (18:41 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 14 Aug 2010 15:41:22 +0000 (18:41 +0300)
 mouse.el (mouse-yank-primary): On MS-Windows and MS-DOS, call
 x-get-selection-value in preference to x-get-selection.

lisp/ChangeLog
lisp/mouse.el

index d61c11b4ef55ce73a8bf1e01226915144e824ac0..dee217104db19e42ffb53c8ecb0be81d05cb65c3 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-14  Eli Zaretskii  <eliz@gnu.org>
+
+       * mouse.el (mouse-yank-primary): Fix mouse-2 on MS-Windows and
+       MS-DOS.  (Bug#6689)
+
 2010-08-13  Jan Djärv  <jan.h.d@swipnet.se>
 
        * menu-bar.el (menu-bar-set-tool-bar-position): New function.
index 3bc3fcefa80c7abe31fbcfb675ce3e45602ebf02..89a136434d9b5787d29179f676c474f2341f34c4 100644 (file)
@@ -1265,10 +1265,17 @@ regardless of where you click."
     ;; the middle of an active region.
     (deactivate-mark))
   (or mouse-yank-at-point (mouse-set-point click))
-  (let ((primary (x-get-selection 'PRIMARY)))
+  (let ((primary
+        (cond
+         ((fboundp 'x-get-selection-value) ; MS-DOS and MS-Windows
+          (or (x-get-selection-value)
+              (x-get-selection 'PRIMARY)))
+         ;; FIXME: What about xterm-mouse-mode etc.?
+         (t
+          (x-get-selection 'PRIMARY)))))
     (if primary
         (insert primary)
-      (error "No primary selection"))))
+      (error "No selection is available"))))
 
 (defun mouse-kill-ring-save (click)
   "Copy the region between point and the mouse click in the kill ring.