The function
set-selection
sets the primary selection to be the text of
string
.
On Windows there is no notion of selection, so this mechanism is internal to Lisp.
Note that X applications may or may not use the primary selection for their paste operations. The most likely explanation for apparent inconsistencies after
set-selection
is that the pasting application doesn't use the primary selection. For instance, Emacs is configurable by the variable interprogram-paste-function.