NextPrevUpTopContentsIndex

3.15 Indentation

This section contains details of commands used to indent text. Indentation is usually achieved by inserting tab or space characters into the text so as to indent that text a predefined number of spaces.

The effect of the editor indentation commands depends on the major mode of the buffer. Where relevant, the command details given below provide information on how they operate in Text mode and Lisp mode. The operation of commands in Fundamental mode is generally the same as that of Text mode.

Indent

Editor Command

Arguments: None
Key sequence: Tab

In Text mode, Spaces-For-Tab #\Space characters are inserted. A prefix argument causes this to occur at the start of the appropriate number of lines (starting from the current line).

In Lisp mode, the current line is indented according to the structure of the current Lisp form. A prefix argument p causes p lines to be indented according to Lisp syntax.

See editor:*indent-with-tabs* for control over the insertion of #\Tab characters by this and other indentation commands.

Spaces-For-Tab

Editor Variable

Default value: 8

Determines the width of the whitespace used for tabs.

Indent Region

Editor Command

Arguments: None
Key sequence: Alt+Ctrl+\

Indents all the text in the region between the mark and the current point.

In Text mode a block of whitespace, which is Spaces-For-Tab wide, is inserted at the start of each line within the region.

In Lisp mode the text is indented according to the syntax of the Lisp form.

In both cases, a prefix argument causes any existing indentation to be deleted and replaced with a block of whitespace of the appropriate width.

Indent Rigidly

Editor Command

Arguments: None
Key sequence: Ctrl+X Tab or Ctrl+X Ctrl+I

Indents each line in the region between the current point and the mark by a block of whitespace which is Spaces-For-Tab wide. Any existing whitespace at the beginning of the lines is retained.

A positive prefix argument causes the lines to be indented by the appropriate number of spaces, in addition to their existing space. A negative prefix argument causes the lines to be shifted to the left by the appropriate number of spaces. Where necessary, tabs are converted to spaces.

Delete Indentation

Editor Command

Arguments: None
Key sequence: Alt+Shift+^

Joins the current line with the previous one, deleting all whitespace at the beginning of the current line and at the end of the previous line. The deleted whitespace is normally replaced with a single space. However, if the deleted whitespace is at the beginning of a line, or immediately after a ( , or immediately before a ) , then the whitespace is merely deleted without any characters being inserted. If the preceding character is a sentence terminator, then two spaces are left instead of one.

A prefix argument causes the following line to be joined with the current line.

Back to Indentation

Editor Command

Arguments: None
Key sequence: Alt+M

Moves the current point to the first character in the current line that is not a whitespace character.

Indent New Line

Editor Command

Arguments: None
Key sequence: None

Moves everything to the right of the current point to a new line and indents it. Any whitespace before the current point is deleted. If there is a Fill-Prefix, this is inserted at the start of the new line instead.

A prefix argument causes the current point to be moved down the appropriate number of lines and indented.

Quote Tab

Editor Command

Arguments: None
Key sequence: None

Inserts a Tab character.

A prefix argument causes the appropriate number of tab characters to be inserted.


LispWorks Editor User Guide (Windows version) - 23 Mar 2005

NextPrevUpTopContentsIndex