Mercurial > emacs
comparison lisp/mouse.el @ 109781:c89afd5304b0
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.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Sat, 14 Aug 2010 18:41:22 +0300 |
parents | 472b3dda3de7 |
children | f4192807d8a6 |
comparison
equal
deleted
inserted
replaced
109780:300a489dd304 | 109781:c89afd5304b0 |
---|---|
1263 (when select-active-regions | 1263 (when select-active-regions |
1264 ;; Without this, confusing things happen upon e.g. inserting into | 1264 ;; Without this, confusing things happen upon e.g. inserting into |
1265 ;; the middle of an active region. | 1265 ;; the middle of an active region. |
1266 (deactivate-mark)) | 1266 (deactivate-mark)) |
1267 (or mouse-yank-at-point (mouse-set-point click)) | 1267 (or mouse-yank-at-point (mouse-set-point click)) |
1268 (let ((primary (x-get-selection 'PRIMARY))) | 1268 (let ((primary |
1269 (cond | |
1270 ((fboundp 'x-get-selection-value) ; MS-DOS and MS-Windows | |
1271 (or (x-get-selection-value) | |
1272 (x-get-selection 'PRIMARY))) | |
1273 ;; FIXME: What about xterm-mouse-mode etc.? | |
1274 (t | |
1275 (x-get-selection 'PRIMARY))))) | |
1269 (if primary | 1276 (if primary |
1270 (insert primary) | 1277 (insert primary) |
1271 (error "No primary selection")))) | 1278 (error "No selection is available")))) |
1272 | 1279 |
1273 (defun mouse-kill-ring-save (click) | 1280 (defun mouse-kill-ring-save (click) |
1274 "Copy the region between point and the mouse click in the kill ring. | 1281 "Copy the region between point and the mouse click in the kill ring. |
1275 This does not delete the region; it acts like \\[kill-ring-save]." | 1282 This does not delete the region; it acts like \\[kill-ring-save]." |
1276 (interactive "e") | 1283 (interactive "e") |