comparison lisp/mouse.el @ 87387:e73e483c5735

(mouse-yank-primary): New function (almost same as mouse-yank-secondary).
author Richard M. Stallman <rms@gnu.org>
date Tue, 25 Dec 2007 20:05:47 +0000
parents 1d6e3255f024
children 4c3c683cdff8 56a72e2bd635
comparison
equal deleted inserted replaced
87386:9ec633b7a53d 87387:e73e483c5735
1355 (run-hooks 'mouse-leave-buffer-hook) 1355 (run-hooks 'mouse-leave-buffer-hook)
1356 (or mouse-yank-at-point (mouse-set-point click)) 1356 (or mouse-yank-at-point (mouse-set-point click))
1357 (setq this-command 'yank) 1357 (setq this-command 'yank)
1358 (setq mouse-selection-click-count 0) 1358 (setq mouse-selection-click-count 0)
1359 (yank arg)) 1359 (yank arg))
1360
1361 (defun mouse-yank-primary (click)
1362 "Insert the primary selection at the position clicked on.
1363 Move point to the end of the inserted text.
1364 If `mouse-yank-at-point' is non-nil, insert at point
1365 regardless of where you click."
1366 (interactive "e")
1367 ;; Give temporary modes such as isearch a chance to turn off.
1368 (run-hooks 'mouse-leave-buffer-hook)
1369 (or mouse-yank-at-point (mouse-set-point click))
1370 (let ((primary (x-get-selection 'PRIMARY)))
1371 (if primary
1372 (insert (x-get-selection 'PRIMARY))
1373 (error "No primary selection"))))
1360 1374
1361 (defun mouse-kill-ring-save (click) 1375 (defun mouse-kill-ring-save (click)
1362 "Copy the region between point and the mouse click in the kill ring. 1376 "Copy the region between point and the mouse click in the kill ring.
1363 This does not delete the region; it acts like \\[kill-ring-save]." 1377 This does not delete the region; it acts like \\[kill-ring-save]."
1364 (interactive "e") 1378 (interactive "e")