[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indentation of functions inside flet

From: egnarts-ms
Subject: Re: indentation of functions inside flet
Date: Fri, 20 Jan 2012 06:37:55 -0800 (PST)

Stefan Monnier wrote:
>> So it would be nice if Lisp mode indented such function definitions like
>> defuns.  I wonder, has anyone cared about this before me (I'm sure
>> someone
>> has) and are there any improvements to the Lisp mode available ?
> It would be nice if CL macros were indented better, I agree.
> Note that the way to do it is to put the bulk of the code in cl(-*).el and
> only change lisp-mode.el so as to provide hooks that CL needs.
>         Stefan

Basically, what is wrong with the current indentation mechanism is its

We have a possibility to specify how to indent macro forms, by attaching
"lisp-indent-function" property to macro symbols, usually with (declare
(indent ...)) declaration.  But the key moment is this: indentation analysis
is limited to only the immediate enclosing list.  Once we want to indent at
some point, we find out what is the innermost containing sexp, then we take
its car and analyze it.  So the car of immediate parent fully determines the
indentation pattern.  No further upward search is performed.

For most cases this behavior is perfectly OK, but, as we see, for
"flet"-like forms this is not the case.
View this message in context: 
Sent from the Emacs - Dev mailing list archive at Nabble.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]