Function: gui-backend-set-selection

gui-backend-set-selection is a byte-compiled function defined in select.el.gz.

Signature

(gui-backend-set-selection SELECTION VALUE)

Documentation

Method to assert a selection of type SELECTION and value VALUE.

SELECTION is a symbol, typically PRIMARY, SECONDARY, or CLIPBOARD. If VALUE is nil and we own the selection SELECTION, disown it instead. Disowning it means there is no such selection.
(Those are literal upper-case symbol names, since that's what X expects.)
VALUE is typically a string, or a cons of two markers, but may be anything that the functions on selection-converter-alist know about.

Implementations

(type data (nil ((&context . window-system) eql 'nil)) (nil ((&context terminal-parameter nil 'xterm--set-selection) eql t))) in `term/xterm.el'.

Copy DATA to the X selection using the OSC 52 escape sequence.

TYPE specifies which selection to set; it must be either `PRIMARY' or `CLIPBOARD'. DATA must be a string.

This can be used as a `gui-set-selection' method for xterm-compatible terminal emulators. Then your system clipboard will be updated whenever you copy a region of text in Emacs.

If the resulting OSC 52 sequence would be longer than `xterm-max-cut-length', then the TEXT is not sent to the system clipboard.

This function either sends a raw OSC 52 sequence or wraps the OSC 52 in a Device Control String sequence. This way, it will work on a bare terminal emulators as well as inside the screen program. When inside the screen program, this function also chops long DCS sequences into multiple smaller ones to avoid hitting screen's max DCS length.

(selection value) in `select.el'.

Undocumented

Source Code

;; Defined in /usr/src/emacs/lisp/select.el.gz
(cl-defgeneric gui-backend-set-selection (_selection _value)
  "Method to assert a selection of type SELECTION and value VALUE.
SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
If VALUE is nil and we own the selection SELECTION, disown it instead.
Disowning it means there is no such selection.
\(Those are literal upper-case symbol names, since that's what X expects.)
VALUE is typically a string, or a cons of two markers, but may be
anything that the functions on `selection-converter-alist' know about."
  nil)