Function: mouse-yank-primary

mouse-yank-primary is an interactive and byte-compiled function defined in mouse.el.gz.

Signature

(mouse-yank-primary &optional EVENT)

Documentation

Insert the primary selection, Move point to the end of the inserted text, and set mark at beginning. If mouse-yank-at-point is non-nil, insert at point otherwise insert it at the position of EVENT.

View in manual

Probably introduced at or before Emacs version 23.2.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mouse.el.gz
(defun mouse-yank-primary (&optional event)
  "Insert the primary selection,
Move point to the end of the inserted text, and set mark at
beginning.  If `mouse-yank-at-point' is non-nil, insert at point
otherwise insert it at the position of EVENT."
  (interactive (list last-nonmenu-event))
  ;; Give temporary modes such as isearch a chance to turn off.
  (run-hooks 'mouse-leave-buffer-hook)
  ;; Without this, confusing things happen upon e.g. inserting into
  ;; the middle of an active region.
  (when select-active-regions
    (let (select-active-regions)
      (deactivate-mark)))
  (or mouse-yank-at-point (mouse-set-point event))
  (let ((primary (gui-get-primary-selection)))
    (push-mark)
    (insert-for-yank primary)))