kill-region
is the usual subroutine for killing text. Any
command that calls this function is a "kill command" (and should
probably have `kill' in its name). kill-region
puts the
newly killed text in a new element at the beginning of the kill ring or
adds it to the most recent element. It uses the last-command
variable to determine whether the previous command was a kill command,
and if so appends the killed text to the most recent entry.
nil
.
In an interactive call, start and end are point and the mark.
If the buffer is read-only, kill-region
modifies the kill ring
just the same, then signals an error without modifying the buffer. This
is convenient because it lets the user use all the kill commands to copy
text into the kill ring from a read-only buffer.
nil
. It also indicates the extent
of the text copied by moving the cursor momentarily, or by displaying a
message in the echo area.
The command does not set this-command
to kill-region
, so a
subsequent kill command does not append to the same kill ring entry.
Don't call copy-region-as-kill
in Lisp programs unless you aim to
support Emacs 18. For Emacs 19, it is better to use kill-new
or
kill-append
instead. See section Low-Level Kill Ring.
Go to the first, previous, next, last section, table of contents.