Next: Accessing Selections, Previous: ポインターの形状, Up: フレーム [Contents][Index]
In window systems, such as X, data can be transferred between different applications by means of selections. Each window system defines an arbitrary number of selection types, all storing their own data; however, only three are commonly used: the clipboard, primary selection, and secondary selection. See Cut and Paste in The GNU Emacs Manual, for Emacs commands that make use of these selections. This section documents the low-level functions for reading and setting window-system selections; See Accessing Selections, for documentation concerning selection types and data formats under particular window systems.
この関数はウィンドウシステムの選択をセットする。これは選択タイプtype、それに割り当てる値dataという2つの引数を受け取る。
type should be a symbol; it is usually one of PRIMARY
,
SECONDARY
or CLIPBOARD
. These are generally symbols with
upper-case names, in accord with X Window System conventions. If type
is nil
, that stands for PRIMARY
.
dataがnil
なら、それはその選択をクリアーすることを意味する。それ以外ならdataは文字列、シンボル、整数、オーバーレイ、同じバッファーを指す2つのマーカーのコンスを指定できる。オーバーレイとマーカーのペアは、そのオーバーレイまたはマーカー間のテキストを意味する。引数dataには有効な非ベクターの選択のベクターも指定できる。
dataが文字列なら、そのテキストプロパティによって個々のデータタイプに使用する値を指定できる。たとえばdataがtext/uri-list
という名前のテキストプロパティを保有していれば、データタイプtext/uri-list
とともにgui-get-selection
を呼び出すことによって、data自身のかわりにそのプロパティの値が使用される。
この関数はdataをリターンする。
この関数はEmacsや他のプログラムによりセットアップされた選択にアクセスする。これはtypeとdata-typeの2つの引数を受け取る。typeは選択のタイプでありデフォルトはPRIMARY
。
The data-type argument specifies the form of data conversion to use, to convert the raw data obtained from another program into Lisp data. See X Selections, for an enumeration of data types valid under X, and See Other Selections for those elsewhere.
This variable provides a coding system (see コーディングシステム) which is used to encode selection data, and takes effect on MS-Windows and X. It is also used in the MS-DOS port when it runs on MS-Windows and can access the Windows clipboard text.
On X, the value of this variable provides the coding system which
gui-get-selection
will use to decode selection data for a subset of
text data types, and also forces replies to selection requests for the
polymorphic TEXT
data type to be encoded by the
compound-text-with-extensions
coding system rather than Unicode.
On MS-Windows, this variable is generally ignored, as the MS-Windows clipboard provides the information about decoding as part of the clipboard data, and uses either UTF-16 or locale-specific encoding automatically as appropriate. We recommend to set the value of this variable only on the older Windows 9X, as it is otherwise used only in the very rare cases when the information provided by the clipboard data is unusable for some reason.
The default value of this variable is the system code page under MS-Windows
95, 98 or Me, utf-16le-dos
on Windows NT/W2K/XP/Vista/7/8/10/11,
iso-latin-1-dos
on MS-DOS, and nil
elsewhere.
後方互換性のためにgui-get-selection
とgui-set-selection
にたいして、Emacs
25.1以前の名前x-get-selection
とx-set-selection
が時代遅れのエイリアスとして存在します。
Next: Accessing Selections, Previous: ポインターの形状, Up: フレーム [Contents][Index]