Next: , Previous: , Up: フレーム   [Contents][Index]


30.21 ウィンドウシステムによる選択

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.

Command: gui-set-selection type data

この関数はウィンドウシステムの選択をセットする。これは選択タイプ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.

datanilなら、それはその選択をクリアーすることを意味する。それ以外ならdataは文字列、シンボル、整数、オーバーレイ、同じバッファーを指す2つのマーカーのコンスを指定できる。オーバーレイとマーカーのペアは、そのオーバーレイまたはマーカー間のテキストを意味する。引数dataには有効な非ベクターの選択のベクターも指定できる。

dataが文字列なら、そのテキストプロパティによって個々のデータタイプに使用する値を指定できる。たとえばdatatext/uri-listという名前のテキストプロパティを保有していれば、データタイプtext/uri-listとともにgui-get-selectionを呼び出すことによって、data自身のかわりにそのプロパティの値が使用される。

この関数はdataをリターンする。

Function: gui-get-selection &optional type data-type

この関数はEmacsや他のプログラムによりセットアップされた選択にアクセスする。これはtypedata-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.

User Option: selection-coding-system

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-selectiongui-set-selectionにたいして、Emacs 25.1以前の名前x-get-selectionx-set-selectionが時代遅れのエイリアスとして存在します。


Next: Accessing Selections, Previous: ポインターの形状, Up: フレーム   [Contents][Index]

This page has generated for branch:master, commit:762705fb24fd90db318f2e51c1e762452d26f7e2 to check Japanese translation.