Next: , Previous: , Up: X-Windows   [Contents][Index]


59.1 X Selections

The X server records a set of selections which permit transfer of data between application programs. The various selections are distinguished by selection types, represented in SXEmacs by symbols. X clients including SXEmacs can read or set the selection for any given type.

Function: x-own-selection data &optional type

This function sets a “selection” in the X server. It takes two arguments: a value, data, and the selection type type to assign it to. data may be a string, a cons of two markers, or an extent. In the latter cases, the selection is considered to be the text between the markers, or between the extent’s endpoints.

Each possible type has its own selection value, which changes independently. The usual values of type are PRIMARY and SECONDARY; these are symbols with upper-case names, in accord with X Windows conventions. The default is PRIMARY.

(In FSF Emacs, this function is called x-set-selection and takes different arguments.)

Function: x-get-selection

This function accesses selections set up by SXEmacs or by other X clients. It returns the value of the current primary selection.

Function: x-disown-selection &optional secondary-p

Assuming we own the selection, this function disowns it. If secondary-p is non-nil, the secondary selection instead of the primary selection is discarded.

The X server also has a set of numbered cut buffers which can store text or other data being moved between applications. Cut buffers are considered obsolete, but SXEmacs supports them for the sake of X clients that still use them.

Function: x-get-cutbuffer &optional n

This function returns the contents of cut buffer number n. (This function is called x-get-cut-buffer in FSF Emacs.)

Function: x-store-cutbuffer string &optional push

This function stores string into the first cut buffer (cut buffer 0).

Normally, the contents of the first cut buffer are simply replaced by string. However, if optional argument push is non-nil, the cut buffers are rotated. This means that the previous value of the first cut buffer moves to the second cut buffer, and the second to the third, and so on, moving the other values down through the series of cut buffers, kill-ring-style. There are 8 cut buffers altogether.

Cut buffers are considered obsolete; you should use selections instead.

This function has no effect if support for cut buffers was not compiled in.

This function is called x-set-cut-buffer in FSF Emacs.


Next: , Previous: , Up: X-Windows   [Contents][Index]