[slime-devel] macro-indentation should ignore &optional

darkness darkness-keyword-gmane.42aa79 at caliginous.net
Thu Feb 9 23:06:05 UTC 2006


Greetings.  I've got a macro like:

(defmacro tbf (&optional bar &body baz) ...)

With SLIME from CVS, this gets indented as:

(tbf (:arg value)
    (form1)
  (form2))

Whereas I think the correct indentation should be:

(tbf (:arg value)
  (form1)
  (form2))

The problem (as I see it) is that swank:macro-indent counts &optional as
an argument, rather than as a lambda list keyword.  Below is a simple
patch against SLIME CVS.


===================================================================
RCS file: /project/slime/cvsroot/slime/swank.lisp,v
retrieving revision 1.360
diff -u -r1.360 swank.lisp
--- swank.lisp  6 Feb 2006 18:42:09 -0000       1.360
+++ swank.lisp  9 Feb 2006 17:16:26 -0000
@@ -4369,7 +4369,7 @@

 (defun macro-indentation (arglist)
   (if (well-formed-list-p arglist)
-      (position '&body (clean-arglist arglist))
+      (position '&body (remove '&optional (clean-arglist arglist)))
       nil))

 (defun well-formed-list-p (list)





More information about the slime-devel mailing list