Next: Yank Commands, Previous: Kill Functions, Up: The Kill Ring
Yanking means inserting text from the kill ring, but it does
not insert the text blindly. Yank commands and some other commands
use insert-for-yank to perform special processing on the
text that they copy into the buffer.
This function normally works like
insertexcept that it doesn't insert the text properties in theyank-excluded-propertieslist. However, if any part of string has a non-nilyank-handlertext property, that property can do various special processing on that part of the text being inserted.
This function resembles
insert-buffer-substringexcept that it doesn't insert the text properties in theyank-excluded-propertieslist.
You can put a yank-handler text property on all or part of
the text to control how it will be inserted if it is yanked. The
insert-for-yank function looks for that property. The property
value must be a list of one to four elements, with the following
format (where elements after the first may be omitted):
(function param noexclude undo)
Here is what the elements do:
nil, it is called instead of
insert to insert the string. function takes one
argument—the string to insert.
nil, it replaces string
(or the part of string being processed) as the object passed to
function (or insert); for example, if function is
yank-rectangle, param should be a list of strings to
insert as a rectangle.
nil, the normal removal of the
yank-excluded-properties is not performed; instead function is
responsible for removing those properties. This may be necessary
if function adjusts point before or after inserting the object.
nil, it is a function that will be
called by yank-pop to undo the insertion of the current object.
It is called with two arguments, the start and end of the current
region. function can set yank-undo-function to override
the undo value.