Next: , Previous: , Up: Miscellaneous  


5.3: Miscellaneous

Q5.3.1: How do you make SXEmacs indent CL if-clauses correctly?

I’d like SXEmacs to indent all the clauses of a Common Lisp if the same amount instead of indenting the 3rd clause differently from the first two.

One way is to add, to init.el:

(put 'if 'lisp-indent-function nil)

However, note that the package cl-indent that comes with SXEmacs sets up this kind of indentation by default. cl-indent also knows about many other CL-specific forms. To use cl-indent, one can do this:

(load "cl-indent")
(setq lisp-indent-function (function common-lisp-indent-function))

One can also customize cl-indent.el so it mimics the default if indentation then indented more than the else. Here’s how:

(put 'if 'common-lisp-indent-function '(nil nil &body))