These functions and variables provide access to the kill ring at a lower level, but still convenient for use in Lisp programs. They take care of interaction with X Window selections. They do not exist in Emacs version 18.
The function
current-killrotates the yanking pointer which designates the “front” of the kill ring by count places (from newer kills to older ones), and returns the text at that place in the ring.If the optional second argument do-not-move is non-
nil, thencurrent-killdoesn't alter the yanking pointer; it just returns the countth kill, counting from the current yanking pointer.If count is zero, indicating a request for the latest kill,
current-killcalls the value ofinterprogram-paste-function(documented below) before consulting the kill ring.
This function makes the text string the latest entry in the kill ring, and sets
kill-ring-yank-pointerto point to it.Normally, string is added to the front of the kill ring as a new entry. However, if optional argument replace is non-
nil, the entry previously at the front of the kill ring is discarded, and string replaces it.This function runs the functions on
kill-hooks, and also invokes the value ofinterprogram-cut-function(see below).
This function appends the text string to the first entry in the kill ring. Normally string goes at the end of the entry, but if before-p is non-
nil, it goes at the beginning. This function also invokes the value ofinterprogram-cut-function(see below).
This variable provides a way of transferring killed text from other programs, when you are using a window system. Its value should be
nilor a function of no arguments.If the value is a function,
current-killcalls it to get the “most recent kill”. If the function returns a non-nilvalue, then that value is used as the “most recent kill”. If it returnsnil, then the first element ofkill-ringis used.The normal use of this hook is to get the X server's primary selection as the most recent kill, even if the selection belongs to another X client. See X Selections.
This variable provides a way of communicating killed text to other programs, when you are using a window system. Its value should be
nilor a function of one argument.If the value is a function,
kill-newandkill-appendcall it with the new first element of the kill ring as an argument.The normal use of this hook is to set the X server's primary selection to the newly killed text.