In addition to the primary selection, the X Window System provides a second similar facility known as the secondary selection. Nowadays, few X applications make use of the secondary selection, but you can access it using the following Emacs commands:
Set the secondary selection, with one end at the place where you press
down the button, and the other end at the place where you release it
mouse-set-secondary). The selected text is highlighted, using
secondary-selection face, as you drag. The window scrolls
automatically if you drag the mouse off the top or bottom of the
window, just like
mouse-set-region (see Mouse Commands).
This command does not alter the kill ring.
Set one endpoint for the secondary selection
Set the secondary selection, with one end at the position clicked and
the other at the position specified with M-Mouse-1
mouse-secondary-save-then-kill). This also puts the selected
text in the kill ring. A second M-Mouse-3 at the same place
kills the secondary selection just made.
Insert the secondary selection where you click, placing point at the
end of the yanked text (
Double or triple clicking of M-Mouse-1 operates on words and lines, much like Mouse-1.
mouse-yank-at-point is non-
nil, M-Mouse-2 yanks
at point. Then it does not matter precisely where you click, or even
which of the frame’s windows you click on. See Mouse Commands.