Function: gui-select-text
gui-select-text is a byte-compiled function defined in select.el.gz.
Signature
(gui-select-text TEXT)
Documentation
Select TEXT, a string, according to the window system.
if select-enable-clipboard is non-nil, copy TEXT to the system's clipboard.
If select-enable-primary is non-nil, put TEXT in the primary selection.
MS-Windows does not have a "primary" selection.
Probably introduced at or before Emacs version 25.1.
Aliases
x-select-text (obsolete since 25.1)
Source Code
;; Defined in /usr/src/emacs/lisp/select.el.gz
(defun gui-select-text (text)
"Select TEXT, a string, according to the window system.
if `select-enable-clipboard' is non-nil, copy TEXT to the system's clipboard.
If `select-enable-primary' is non-nil, put TEXT in the primary selection.
MS-Windows does not have a \"primary\" selection."
(when select-enable-primary
(gui-set-selection 'PRIMARY text)
(setq gui--last-selected-text-primary text))
(when select-enable-clipboard
;; When cutting, the selection is cleared and PRIMARY
;; set to the empty string. Prevent that, PRIMARY
;; should not be reset by cut (Bug#16382).
(setq saved-region-selection text)
(gui-set-selection 'CLIPBOARD text)
(setq gui--last-selected-text-clipboard text)))