FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version


Arguments: symbol

Returns (or sets with setf a list of integers that specifies how a source code form whose first element is symbol will be indented in the IDE editor if the form is wrapped to multiple lines. Each integer in the list specifies the number of spaces to the right of the form's opening parenthesis by which a corresponding element of the source code form will be indented if it begins a line of source code. The first integer corresponds to the second element of the source code form (typically the first argument to a function), the second integer corresponds to the third element of the form, and so on. The last integer in the list is also used for all leftover elements of the form when the form is longer than one plus the length of the integer list.

For example,

(text-edit-indentation 'defclass) 

returns the list

(4 4 2)

That indicates that the name of the class and the list of superclasses will each be indented by four spaces when they occur at the beginning of a line, and the rest of the defclass form will be indented by two spaces.

text-edit-indentation returns nil when no indentation has been specified for a symbol, and the IDE editor uses a default indentation for forms beginning with that symbol. If a newline exists after the first element of a form (or if the first element of the form is not a symbol), then the default indentation is one space. Otherwise successive lines are aligned to the right of the form's initial symbol.

This facility is not nearly as powerful as it might be. For example, there is no way to make a defmethod form indent its parameter list by a certain amount regardless of whether the form contains a qualifier (such as :after) before the parameter list. So this feature may be enhanced in the future, and enhancement may be incompatible. For now, certain definers such as if* and loop have hardcoded indentation styles since this general specification is not adequate.

text-edit-indentation specifications are provided for many symbols, but users may want to add specifications for additional symbols, especially their own. This may be useful for function or macro names whose first one or two arguments are special in some way and indenting these arguments differently may clarify their special status. It may also be useful for reducing overall indentation when some arguments are placed on the same line as a defining symbol, since the default is to align successive lines at the far right of the defining symbol.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.

Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version