Next Previous Up Top Contents Index

5 Advanced Features

5.2 Customizing Lisp indentation

The indentation used for Lisp forms can be modified to suit the preferences of the user.

The default indentations can be found in the fileconfig/indents.lisp in the LispWorks library directory. If you want to alter your personal Lisp indentation, put the modifying code in your.lispworks file.

editor:setup-indent

Function

editor:setup-indent form-name no-of-args &optional standard special

Modifies the indentation, in Lisp Mode, for the text following an instance of form-name. The arguments no-of-args, standard and special should all be integers. The first no-of-args forms following the form-name become indented special spaces if they are on a new line. All remaining forms within the scope of the form-name become indented standard spaces.
For example, the default indentation forif in Lisp code is established by:
(editor:setup-indent "if" 2 2 4)

This determines that the first 2 forms after the if (i.e. thetest and thethen clauses) get indented 4 spaces relative to theif, and any further forms (here, just anelse clause) are indented by 2 spaces.

LispWorks Editor User Guide - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker