diff options
Diffstat (limited to 'devdocs/elisp/low_002dlevel-kill-ring.html')
| -rw-r--r-- | devdocs/elisp/low_002dlevel-kill-ring.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/devdocs/elisp/low_002dlevel-kill-ring.html b/devdocs/elisp/low_002dlevel-kill-ring.html new file mode 100644 index 00000000..a169e30c --- /dev/null +++ b/devdocs/elisp/low_002dlevel-kill-ring.html @@ -0,0 +1,24 @@ + <h4 class="subsection">Low-Level Kill Ring</h4> <p>These functions and variables provide access to the kill ring at a lower level, but are still convenient for use in Lisp programs, because they take care of interaction with window system selections (see <a href="window-system-selections">Window System Selections</a>). </p> <dl> <dt id="current-kill">Function: <strong>current-kill</strong> <em>n &optional do-not-move</em> +</dt> <dd> +<p>The function <code>current-kill</code> rotates the yanking pointer, which designates the front of the kill ring, by <var>n</var> places (from newer kills to older ones), and returns the text at that place in the ring. </p> <p>If the optional second argument <var>do-not-move</var> is non-<code>nil</code>, then <code>current-kill</code> doesn’t alter the yanking pointer; it just returns the <var>n</var>th kill, counting from the current yanking pointer. </p> <p>If <var>n</var> is zero, indicating a request for the latest kill, <code>current-kill</code> calls the value of <code>interprogram-paste-function</code> (documented below) before consulting the kill ring. If that value is a function and calling it returns a string or a list of several strings, <code>current-kill</code> pushes the strings onto the kill ring and returns the first string. It also sets the yanking pointer to point to the kill-ring entry of the first string returned by <code>interprogram-paste-function</code>, regardless of the value of <var>do-not-move</var>. Otherwise, <code>current-kill</code> does not treat a zero value for <var>n</var> specially: it returns the entry pointed at by the yanking pointer and does not move the yanking pointer. </p> +</dd> +</dl> <dl> <dt id="kill-new">Function: <strong>kill-new</strong> <em>string &optional replace</em> +</dt> <dd> +<p>This function pushes the text <var>string</var> onto the kill ring and makes the yanking pointer point to it. It discards the oldest entry if appropriate. It also invokes the values of <code>interprogram-paste-function</code> (subject to the user option <code>save-interprogram-paste-before-kill</code>) and <code>interprogram-cut-function</code> (see below). </p> <p>If <var>replace</var> is non-<code>nil</code>, then <code>kill-new</code> replaces the first element of the kill ring with <var>string</var>, rather than pushing <var>string</var> onto the kill ring. </p> +</dd> +</dl> <dl> <dt id="kill-append">Function: <strong>kill-append</strong> <em>string before-p</em> +</dt> <dd><p>This function appends the text <var>string</var> to the first entry in the kill ring and makes the yanking pointer point to the combined entry. Normally <var>string</var> goes at the end of the entry, but if <var>before-p</var> is non-<code>nil</code>, it goes at the beginning. This function calls <code>kill-new</code> as a subroutine, thus causing the values of <code>interprogram-cut-function</code> and possibly <code>interprogram-paste-function</code> (see below) to be invoked by extension. </p></dd> +</dl> <dl> <dt id="interprogram-paste-function">Variable: <strong>interprogram-paste-function</strong> +</dt> <dd> +<p>This variable provides a way of transferring killed text from other programs, when you are using a window system. Its value should be <code>nil</code> or a function of no arguments. </p> <p>If the value is a function, <code>current-kill</code> calls it to get the most recent kill. If the function returns a non-<code>nil</code> value, then that value is used as the most recent kill. If it returns <code>nil</code>, then the front of the kill ring is used. </p> <p>To facilitate support for window systems that support multiple selections, this function may also return a list of strings. In that case, the first string is used as the most recent kill, and all the other strings are pushed onto the kill ring, for easy access by <code>yank-pop</code>. </p> <p>The normal use of this function is to get the window system’s clipboard as the most recent kill, even if the selection belongs to another application. See <a href="window-system-selections">Window System Selections</a>. However, if the clipboard contents come from the current Emacs session, this function should return <code>nil</code>. </p> +</dd> +</dl> <dl> <dt id="interprogram-cut-function">Variable: <strong>interprogram-cut-function</strong> +</dt> <dd> +<p>This variable provides a way of communicating killed text to other programs, when you are using a window system. Its value should be <code>nil</code> or a function of one required argument. </p> <p>If the value is a function, <code>kill-new</code> and <code>kill-append</code> call it with the new first element of the kill ring as the argument. </p> <p>The normal use of this function is to put newly killed text in the window system’s clipboard. See <a href="window-system-selections">Window System Selections</a>. </p> +</dd> +</dl><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/Low_002dLevel-Kill-Ring.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Kill-Ring.html</a> + </p> +</div> |
