From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/relative-indent.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 devdocs/elisp/relative-indent.html (limited to 'devdocs/elisp/relative-indent.html') diff --git a/devdocs/elisp/relative-indent.html b/devdocs/elisp/relative-indent.html new file mode 100644 index 00000000..d6f01263 --- /dev/null +++ b/devdocs/elisp/relative-indent.html @@ -0,0 +1,25 @@ +

Indentation Relative to Previous Lines

This section describes two commands that indent the current line based on the contents of previous lines.

Command: indent-relative &optional first-only unindented-ok +
+

This command inserts whitespace at point, extending to the same column as the next indent point of the previous nonblank line. An indent point is a non-whitespace character following whitespace. The next indent point is the first one at a column greater than the current column of point. For example, if point is underneath and to the left of the first non-blank character of a line of text, it moves to that column by inserting whitespace.

If the previous nonblank line has no next indent point (i.e., none at a great enough column position), indent-relative either does nothing (if unindented-ok is non-nil) or calls tab-to-tab-stop. Thus, if point is underneath and to the right of the last column of a short line of text, this command ordinarily moves point to the next tab stop by inserting whitespace.

If first-only is non-nil, only the first indent point is considered.

The return value of indent-relative is unpredictable.

In the following example, point is at the beginning of the second line:

            This line is indented twelve spaces.
+∗The quick brown fox jumped.
+
+

Evaluation of the expression (indent-relative nil) produces the following:

            This line is indented twelve spaces.
+            ∗The quick brown fox jumped.
+
+

In this next example, point is between the ‘m’ and ‘p’ of ‘jumped’:

            This line is indented twelve spaces.
+The quick brown fox jum∗ped.
+
+

Evaluation of the expression (indent-relative nil) produces the following:

            This line is indented twelve spaces.
+The quick brown fox jum  ∗ped.
+
+
+
Command: indent-relative-first-indent-point +
+

This command indents the current line like the previous nonblank line, by calling indent-relative with t as the first-only argument. The return value is unpredictable.

If the previous nonblank line has no indent points beyond the current column, this command does nothing.

+
+
+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Relative-Indent.html +

+
-- cgit v1.2.3