diff options
Diffstat (limited to 'devdocs/elisp/window-system-selections.html')
| -rw-r--r-- | devdocs/elisp/window-system-selections.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/devdocs/elisp/window-system-selections.html b/devdocs/elisp/window-system-selections.html new file mode 100644 index 00000000..8c5f525c --- /dev/null +++ b/devdocs/elisp/window-system-selections.html @@ -0,0 +1,16 @@ + <h3 class="section">Window System Selections</h3> <p>In window systems, such as X, data can be transferred between different applications by means of <em>selections</em>. X defines an arbitrary number of <em>selection types</em>, each of which can store its own data; however, only three are commonly used: the <em>clipboard</em>, <em>primary selection</em>, and <em>secondary selection</em>. Other window systems support only the clipboard. See <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Cut-and-Paste.html#Cut-and-Paste">Cut and Paste</a> in <cite>The GNU Emacs Manual</cite>, for Emacs commands that make use of these selections. This section documents the low-level functions for reading and setting window-system selections. </p> <dl> <dt id="gui-set-selection">Command: <strong>gui-set-selection</strong> <em>type data</em> +</dt> <dd> +<p>This function sets a window-system selection. It takes two arguments: a selection type <var>type</var>, and the value to assign to it, <var>data</var>. </p> <p><var>type</var> should be a symbol; it is usually one of <code>PRIMARY</code>, <code>SECONDARY</code> or <code>CLIPBOARD</code>. These are symbols with upper-case names, in accord with X Window System conventions. If <var>type</var> is <code>nil</code>, that stands for <code>PRIMARY</code>. </p> <p>If <var>data</var> is <code>nil</code>, it means to clear out the selection. Otherwise, <var>data</var> may be a string, a symbol, an integer (or a cons of two integers or list of two integers), an overlay, or a cons of two markers pointing to the same buffer. An overlay or a pair of markers stands for text in the overlay or between the markers. The argument <var>data</var> may also be a vector of valid non-vector selection values. </p> <p>This function returns <var>data</var>. </p> +</dd> +</dl> <dl> <dt id="gui-get-selection">Function: <strong>gui-get-selection</strong> <em>&optional type data-type</em> +</dt> <dd> +<p>This function accesses selections set up by Emacs or by other programs. It takes two optional arguments, <var>type</var> and <var>data-type</var>. The default for <var>type</var>, the selection type, is <code>PRIMARY</code>. </p> <p>The <var>data-type</var> argument specifies the form of data conversion to use, to convert the raw data obtained from another program into Lisp data. Meaningful values include <code>TEXT</code>, <code>STRING</code>, <code>UTF8_STRING</code>, <code>TARGETS</code>, <code>LENGTH</code>, <code>DELETE</code>, <code>FILE_NAME</code>, <code>CHARACTER_POSITION</code>, <code>NAME</code>, <code>LINE_NUMBER</code>, <code>COLUMN_NUMBER</code>, <code>OWNER_OS</code>, <code>HOST_NAME</code>, <code>USER</code>, <code>CLASS</code>, <code>ATOM</code>, and <code>INTEGER</code>. (These are symbols with upper-case names in accord with X conventions.) The default for <var>data-type</var> is <code>STRING</code>. Window systems other than X usually support only a small subset of these types, in addition to <code>STRING</code>. </p> +</dd> +</dl> <dl> <dt id="selection-coding-system">User Option: <strong>selection-coding-system</strong> +</dt> <dd><p>This variable specifies the coding system to use when reading and writing selections or the clipboard. See <a href="coding-systems">Coding Systems</a>. The default is <code>compound-text-with-extensions</code>, which converts to the text representation that X11 normally uses. </p></dd> +</dl> <p>When Emacs runs on MS-Windows, it does not implement X selections in general, but it does support the clipboard. <code>gui-get-selection</code> and <code>gui-set-selection</code> on MS-Windows support the text data type only; if the clipboard holds other types of data, Emacs treats the clipboard as empty. The supported data type is <code>STRING</code>. </p> <p>For backward compatibility, there are obsolete aliases <code>x-get-selection</code> and <code>x-set-selection</code>, which were the names of <code>gui-get-selection</code> and <code>gui-set-selection</code> before Emacs 25.1. </p><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-System-Selections.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-System-Selections.html</a> + </p> +</div> |
