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

fred indentation



   From: db@mcc.com (David Murray Bridgeland)

   Is there a way to tell fred that certain sexps are to be
   indented differently?  E.g. I'd like the following 

   (flet ((foo (a b) (append (cdr a) (cdr b)))) 
    (foo (foo z x) (foo x z)))

   instead of 

   (flet ((foo (a b) (append (cdr a) (cdr b)))) 
	 (foo (foo z x) (foo x z)))

   How can I tell ed-indent-lisp about flet??

The first form is what you currently get by the indenter.  This happens because
(flet . 1) is on *fred-special-indent-alist*.  You can add additional symbols
onto this list to affect their indenting.

One thing you *won't* get any time soon is proper indenting of the subforms
of FLET, LABELS, and MACROLET.

In other words, you will get

  (flet ((foo (a b c)
              (list a b c)))
   ...)

instead of the more desirable

  (flet ((foo (a b c)
          (list a b c)


This limitations exists because fred's indentation parsing only searches
back a single-level of s-expression, instead of two levels.  In the above
example, it knows that '(list a b c) is inside a sublist which begins
with 'foo, but it doesn't search back another level to see that this
list is in turn contained within an flet.

    -andrew