About Code Formatting Styles Reference (Visual LISP IDE)

AutoLISP expressions can be formatted to fit on a single line or multiple lines.

Note: The Visual LISP IDE is available on Windows only.

Code formatting does not affect the execution of the code, but does make it easier to read. You can add spaces or tabs in a program file manually as you enter an AutoLISP expression, but you can also reformat existing AutoLISP code using the Visual LISP code formatter. The code formatter reformats AutoLISP code based on a series of rules that are represented by formatting options that you can choose in the Format options dialog box.

The following are the two supported formatting styles:

Plane Style

Plane style is when all arguments are placed on the same line and separated by a single space:

(autoload "appload" '("appload"))

The code formatter applies the Plane style when:

Wide Style

Wide style is when the first argument is placed in the same line as the function name, and other arguments are aligned in a column below the first argument.

(autoload "appload"
          '("appload")
                  )

The code formatter applies the Wide style when:

Narrow Style

Narrow style is when the first argument is placed on the next line after the function name, and other arguments are aligned in a column below the first argument. The displacement of the first argument's starting position is relative to the expression starting position controlled by the value of the Narrow Style Indentation option (in the following example, this value is equal to 2):

(autoload
  "appload"
  '("appload")
)

The Narrow formatting style applies for progn expressions, and for those instances when the Plane and Wide formatting styles cannot be applied.

Column Style

The Visual LISP code formatter can position elements into columns. This style is appropriate for displaying quoted lists and Cond-expression clauses.

For example, the following code:

'((10 "{insertion}") (1 "{string}") (7 "{style}"))

would be displayed as:

'((10 "{insertion}")
  (1 "{string}")
  (7 "{style}")
)