diff options
Diffstat (limited to 'devdocs/elisp/deletion.html')
| -rw-r--r-- | devdocs/elisp/deletion.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/devdocs/elisp/deletion.html b/devdocs/elisp/deletion.html new file mode 100644 index 00000000..fb0e3470 --- /dev/null +++ b/devdocs/elisp/deletion.html @@ -0,0 +1,30 @@ + <h3 class="section">Deleting Text</h3> <p>Deletion means removing part of the text in a buffer, without saving it in the kill ring (see <a href="the-kill-ring">The Kill Ring</a>). Deleted text can’t be yanked, but can be reinserted using the undo mechanism (see <a href="undo">Undo</a>). Some deletion functions do save text in the kill ring in some special cases. </p> <p>All of the deletion functions operate on the current buffer. </p> <dl> <dt id="erase-buffer">Command: <strong>erase-buffer</strong> +</dt> <dd> +<p>This function deletes the entire text of the current buffer (<em>not</em> just the accessible portion), leaving it empty. If the buffer is read-only, it signals a <code>buffer-read-only</code> error; if some of the text in it is read-only, it signals a <code>text-read-only</code> error. Otherwise, it deletes the text without asking for any confirmation. It returns <code>nil</code>. </p> <p>Normally, deleting a large amount of text from a buffer inhibits further auto-saving of that buffer because it has shrunk. However, <code>erase-buffer</code> 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. </p> +</dd> +</dl> <dl> <dt id="delete-region">Command: <strong>delete-region</strong> <em>start end</em> +</dt> <dd><p>This command deletes the text between positions <var>start</var> and <var>end</var> in the current buffer, and returns <code>nil</code>. If point was inside the deleted region, its value afterward is <var>start</var>. Otherwise, point relocates with the surrounding text, as markers do. </p></dd> +</dl> <dl> <dt id="delete-and-extract-region">Function: <strong>delete-and-extract-region</strong> <em>start end</em> +</dt> <dd> +<p>This function deletes the text between positions <var>start</var> and <var>end</var> in the current buffer, and returns a string containing the text just deleted. </p> <p>If point was inside the deleted region, its value afterward is <var>start</var>. Otherwise, point relocates with the surrounding text, as markers do. </p> +</dd> +</dl> <dl> <dt id="delete-char">Command: <strong>delete-char</strong> <em>count &optional killp</em> +</dt> <dd> +<p>This command deletes <var>count</var> characters directly after point, or before point if <var>count</var> is negative. If <var>killp</var> is non-<code>nil</code>, then it saves the deleted characters in the kill ring. </p> <p>In an interactive call, <var>count</var> is the numeric prefix argument, and <var>killp</var> 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. </p> <p>The value returned is always <code>nil</code>. </p> +</dd> +</dl> <dl> <dt id="delete-backward-char">Command: <strong>delete-backward-char</strong> <em>count &optional killp</em> +</dt> <dd> + <p>This command deletes <var>count</var> characters directly before point, or after point if <var>count</var> is negative. If <var>killp</var> is non-<code>nil</code>, then it saves the deleted characters in the kill ring. </p> <p>In an interactive call, <var>count</var> is the numeric prefix argument, and <var>killp</var> 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. </p> <p>The value returned is always <code>nil</code>. </p> +</dd> +</dl> <dl> <dt id="backward-delete-char-untabify">Command: <strong>backward-delete-char-untabify</strong> <em>count &optional killp</em> +</dt> <dd> + <p>This command deletes <var>count</var> 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 <var>killp</var> is non-<code>nil</code>, then the command saves the deleted characters in the kill ring. </p> <p>Conversion of tabs to spaces happens only if <var>count</var> is positive. If it is negative, exactly -<var>count</var> characters after point are deleted. </p> <p>In an interactive call, <var>count</var> is the numeric prefix argument, and <var>killp</var> 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. </p> <p>The value returned is always <code>nil</code>. </p> +</dd> +</dl> <dl> <dt id="backward-delete-char-untabify-method">User Option: <strong>backward-delete-char-untabify-method</strong> +</dt> <dd><p>This option specifies how <code>backward-delete-char-untabify</code> should deal with whitespace. Possible values include <code>untabify</code>, the default, meaning convert a tab to many spaces and delete one; <code>hungry</code>, meaning delete all tabs and spaces before point with one command; <code>all</code> meaning delete all tabs, spaces and newlines before point, and <code>nil</code>, meaning do nothing special for whitespace characters. </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/Deletion.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Deletion.html</a> + </p> +</div> |
