Function: mouse-yank-primary

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

Signature

(mouse-yank-primary CLICK)

Documentation

Insert the primary selection at the position clicked on.

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 regardless of where you click.

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 (click)
  "Insert the primary selection at the position clicked on.
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
regardless of where you click."
  (interactive "e")
  ;; 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 click))
  (let ((primary (gui-get-primary-selection)))
    (push-mark)
    (insert-for-yank primary)))