All Manuals > LispWorks Editor User Guide > 4 Editing Lisp Programs

NextPrevUpTopContentsIndex

4.6 Comments

Comment Region

Editor Command

Arguments: None
Key sequence: None

The command Comment Region comments a region according to the mode.

This command has an effect only if the comment-begin variable is set. By default, comment-begin is set in the Lisp, IDL and C modes.

The commented region is the current region, extended to the beginning of the line where the region starts and the end of the line where it ends.

The prefix argument determines the number of repetitions of the comment-begin string when the length of comment-begin is one, as in Lisp mode. When comment-begin is longer, the prefix argument is ignored. If the prefix argument is nil, a single character comment-begin is repeated three times.

Set Comment Column

Editor Command

Argument: None
Key sequence: Ctrl+X ;

Sets the comment column to the current column. A positive prefix argument causes the comment column to be set to the value of the prefix argument.

The value is held in the editor variable comment-column.

Indent for Comment

Editor Command

Argument: None
Key sequence: Alt+;

Creates a new comment or moves to the beginning of an existing comment, indenting it appropriately (see Set Comment Column).

If the current point is in a line already containing a comment, that comment is indented as appropriate, and the current point is moved to the beginning of the comment. An existing double semicolon comment is aligned as for a line of code. An existing triple semicolon comment or a comment starting in column 0, is not moved.

A prefix argument causes comments on the next relevant number of lines to be indented. The current point is moved down the relevant number of lines.

If characters not associated with the comment extend past the comment column, a space is added before starting the comment.

Insert Multi Line Comment For Selection

Editor Command

Argument: None
Key sequence: Alt+#

Inserts multi line comment syntax around the selected text, if any. If there is no selected text and a prefix argument p is supplied, inserts them around p following (or preceding) forms. Otherwise it inserts them at the current point. The point is left on the first character inside the comment.

Up Comment Line

Editor Command

Argument: None
Key sequence: Alt+P

Moves to the previous line and then performs an Indent for Comment.

Down Comment Line

Editor Command

Argument: None
Key sequence: Alt+N

Moves to the next line and then performs an Indent for Comment.

Indent New Comment Line

Editor Command

Argument: None
Key sequence: Alt+J or Alt+Newline

Ends the current comment and starts a new comment on the next line, using the indentation and number of comment start characters from the previous line's comment. If Indent New Comment Line is performed when the current point is not in a comment line, it simply acts as a Return.

Kill Comment

Editor Command

Argument: None
Key sequence: Alt+Ctrl+;

Kills the comment on the current line and moves the current point to the next line. If there is no comment on the current line, the point is simply moved onto the next line. A prefix argument causes the comments on the relevant number of lines to be killed and the current point to be moved appropriately.

The comment is identified by matching against the value of comment-start.

comment-begin

Editor Variable

Default value: ";"
Mode: Lisp

When the value is a string, it is inserted to begin a comment by commands like Indent for Comment and Indent New Comment Line.

comment-start

Editor Variable

Default value: ";"
Mode: Lisp

A string that begins a comment. When the value is a string, it is inserted to start a comment by commands like Indent New Comment Line, or used to identify a comment by commands like Kill Comment.

comment-column

Editor Variable

Default value: 0
Mode: Lisp

Column to start comments in. Set by Set Comment Column.

comment-end

Editor Variable

Default value: nil
Mode: Lisp

String that ends comments. The value nil indicates Newline termination. If the value is a string, it is inserted to end a comment by commands like Indent New Comment Line.


LispWorks Editor User Guide (Windows version) - 9 Dec 2014

NextPrevUpTopContentsIndex