Next: User-Level Deletion, Previous: Commands for Insertion, Up: Text [Contents][Index]
Deletion means removing part of the text in a buffer, without saving it in the kill ring (see The Kill Ring). Deleted text can’t be yanked, but can be reinserted using the undo mechanism (see Undo). Some deletion functions do save text in the kill ring in some special cases.
All of the deletion functions operate on the current buffer, and all
return a value of nil
.
This function deletes the entire text of buffer, leaving it
empty. If the buffer is read-only, it signals a buffer-read-only
error. Otherwise, it deletes the text without asking for any
confirmation. It returns nil
. buffer defaults to the
current buffer if omitted.
Normally, deleting a large amount of text from a buffer inhibits further
auto-saving of that buffer “because it has shrunk”. However,
erase-buffer
does not do this, the idea being that the future
text is not really related to the former text, and its size should not
be compared with that of the former text.
This command deletes the text in buffer in the region defined by
start and end. The value is nil
. If optional
argument buffer is nil
, the current buffer is assumed.
This command deletes count characters directly after point, or
before point if count is negative. count defaults to 1
.
If killp is non-nil
, then it saves the deleted characters
in the kill ring.
In an interactive call, count is the numeric prefix argument, and killp is the unprocessed prefix argument. Therefore, if a prefix argument is supplied, the text is saved in the kill ring. If no prefix argument is supplied, then one character is deleted, but not saved in the kill ring.
The value returned is always nil
.
This command deletes count characters directly before point, or
after point if count is negative. count defaults to 1.
If killp is non-nil
, then it saves the deleted characters
in the kill ring.
In an interactive call, count is the numeric prefix argument, and killp is the unprocessed prefix argument. Therefore, if a prefix argument is supplied, the text is saved in the kill ring. If no prefix argument is supplied, then one character is deleted, but not saved in the kill ring.
The value returned is always nil
.
This command deletes count characters backward, changing tabs
into spaces. When the next character to be deleted is a tab, it is
first replaced with the proper number of spaces to preserve alignment
and then one of those spaces is deleted instead of the tab. If
killp is non-nil
, then the command saves the deleted
characters in the kill ring.
Conversion of tabs to spaces happens only if count is positive. If it is negative, exactly -count characters after point are deleted.
In an interactive call, count is the numeric prefix argument, and killp is the unprocessed prefix argument. Therefore, if a prefix argument is supplied, the text is saved in the kill ring. If no prefix argument is supplied, then one character is deleted, but not saved in the kill ring.
The value returned is always nil
.
Next: User-Level Deletion, Previous: Commands for Insertion, Up: Text [Contents][Index]