On Wed, Dec 10, 2003 at 09:42:20AM +1100, Alain.Picard@memetrics.com wrote:
I think you're right, after doing a bit more investigation. The first one I hit which really annoyed me was M-q which did not reindent the top level form properly (in SLIME). So I looked in ILISP, and M-q was bound to REINDENT-LISP, which is some gawd-awful complicated function which calls a gazillion other complicated functions to do its work.
Then I noticed the emacs provided indent-sexp. :-)
so I guess reindent-defun could be trivially written as [save excursion [goto start of defun] [indent-sexp]] and be bound to M-q.
REINDENT-LISP does more than that, unfortunatly. It will turn
(defun foo (bar) (if bar baz gronk) ; <- note
or
(defun foo (bar) (if bar baz gronk))) ; <- note
into
(defun foo (bar) (if bar baz gronk)) ; <- note
By correcting the number of parans at the end of the defun, it's really easy to make some changes, bang M-q, examine the "shape" of the defun, and if it's "shaped" right, you can be relatively confident it will compile without worrying about insufficient or extra closing parans on the end.
I used to use this feature a lot, and still miss it.
-bcd