All Manuals > Editor User Guide > 4 Editing Lisp Programs

4.4 Forms

4.4.1 Movement, marking and indentation

Forward Form Editor Command

Arguments: None
Key sequence: Meta+Ctrl+F

Moves the current point to the end of the next form. A positive prefix argument causes the point to be moved the required number of forms forwards.

Backward Form Editor Command

Arguments: None
Key sequence: Meta+Ctrl+B

Moves the current point to the beginning of the previous form. A positive prefix argument causes the point to be moved the required number of forms backwards.

Mark Form Editor Command

Arguments: None
Key sequence: Meta+Ctrl+@

Puts the mark at the end of the current form. The current region is that area from the current point to the end of form. A positive prefix argument puts the mark at the end of the relevant form.

Indent Form Editor Command

Arguments: None
Key sequence: Meta+Ctrl+Q

If the current point is located at the beginning of a form, the whole form is indented in a manner that reflects the structure of the form. This command can therefore be used to format a whole definition so that the structure of the definition is apparent.

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

4.4.2 Killing forms

Forward Kill Form Editor Command

Arguments: None
Key sequence: Meta+Ctrl+K

Kills the text from the current point up to the end of the current form. A positive prefix argument causes the relevant number of forms to be killed forwards. A negative prefix argument causes the relevant number of forms to be killed backwards.

Backward Kill Form Editor Command

Arguments: None
Key sequence: Meta+Ctrl+Backspace

Kills the text from the current point up to the start of the current form. A positive prefix argument causes the relevant number of forms to be killed backwards. A negative prefix argument causes the relevant number of forms to be killed forwards.

Kill Backward Up List Editor Command

Arguments: None
Key sequence: None

Kills the form surrounding the current form. The cursor must be on the left parenthesis of the current form. The entire affected area is pushed onto the kill-ring. A prefix argument causes the relevant number of surrounding lists to be removed.

For example, given the following code, with the cursor on the second left parenthesis:

(print (do-some-work 1 2 3))

Kill Backward Up List would kill the outer form leaving this:

(do-some-work 1 2 3)

Also available through the function editor:kill-backward-up-list-command.

Extract List is a synonym for Kill Backward Up List.

4.4.3 Macro-expansion of forms

Macroexpand Form Editor Command

Arguments: None
Key sequence: Ctrl+Shift+M

Macro-expands the form after the current point. The output is sent to the Output window. A prefix argument causes the output to be displayed in the current buffer.

Walk Form Editor Command

Arguments: None
Key sequence: Meta+Shift+M

Produces a macroexpansion of the form after the current point. The output is sent to the Output window. A prefix argument causes the output to be displayed in the current buffer.

Note: Walk Form does not expand the Common Lisp macros cond, prog, prog* and multiple-value-bind, though it does expand their subforms.

4.4.4 Miscellaneous

Transpose Forms Editor Command

Arguments: None
Key sequence: Meta+Ctrl+T

Transposes the forms immediately preceding and following the current point. A zero prefix argument causes the forms at the current point and the current mark to be transposed. A positive prefix argument causes the form at or preceding the current point to be transposed with the form the relevant number of forms forward. A negative prefix argument causes the form at or preceding the current point to be transposed with the form the relevant number of forms backward.

Insert Double Quotes For Selection Editor Command

Arguments: None
Key sequence: Meta+"

Inserts a pair of double-quotes around the selected text, if any. If there is no selected text and a prefix argument p is supplied, insert them around the p following (or preceding) forms. Otherwise insert them at the current point. The point is left on the character after the first double-quote.


Editor User Guide (Unix version) - 01 Dec 2021 19:35:19