# HG changeset patch # User Eli Zaretskii # Date 1281800482 -10800 # Node ID c89afd5304b0e6e28c9a8d712937db6bd1ce2184 # Parent 300a489dd3049cc440f5f92ee7567f40c6de8daf Fix bug #6689 with mouse-2 pasting on Windows. mouse.el (mouse-yank-primary): On MS-Windows and MS-DOS, call x-get-selection-value in preference to x-get-selection. diff -r 300a489dd304 -r c89afd5304b0 lisp/ChangeLog --- a/lisp/ChangeLog Sat Aug 14 15:55:04 2010 +0300 +++ b/lisp/ChangeLog Sat Aug 14 18:41:22 2010 +0300 @@ -1,3 +1,8 @@ +2010-08-14 Eli Zaretskii + + * mouse.el (mouse-yank-primary): Fix mouse-2 on MS-Windows and + MS-DOS. (Bug#6689) + 2010-08-13 Jan Djärv * menu-bar.el (menu-bar-set-tool-bar-position): New function. diff -r 300a489dd304 -r c89afd5304b0 lisp/mouse.el --- a/lisp/mouse.el Sat Aug 14 15:55:04 2010 +0300 +++ b/lisp/mouse.el Sat Aug 14 18:41:22 2010 +0300 @@ -1265,10 +1265,17 @@ ;; 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.