[slime-cvs] CVS update: slime/swank.lisp

Luke Gorrie lgorrie at common-lisp.net
Tue Apr 6 07:46:01 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv22081

Modified Files:
	swank.lisp 
Log Message:
(macro-indentation): Check that the arglist is well-formed. This works
around a problem with ACL returning arglists that aren't real
lambda-lists.

Date: Tue Apr  6 03:46:01 2004
Author: lgorrie

Index: slime/swank.lisp
diff -u slime/swank.lisp:1.159 slime/swank.lisp:1.160
--- slime/swank.lisp:1.159	Mon Apr  5 03:44:02 2004
+++ slime/swank.lisp	Tue Apr  6 03:46:00 2004
@@ -1568,11 +1568,13 @@
 The form is to be used as the `common-lisp-indent-function' property
 in Emacs."
   (if (macro-function symbol)
-      (macro-indentation (read-arglist (ignore-errors (arglist symbol))))
+      (macro-indentation (ignore-errors (read-arglist (arglist symbol))))
       nil))
 
 (defun macro-indentation (arglist)
-  (position '&body (remove '&whole arglist)))
+  (if (well-formed-list-p arglist)
+      (position '&body (remove '&whole arglist))
+      nil))
 
 (defun read-arglist (args)
   (etypecase args
@@ -1581,6 +1583,13 @@
     (string
      (with-temp-package *package*
        (read-from-string args)))))
+
+(defun well-formed-list-p (list)
+  "Is LIST a proper list terminated by NIL?"
+  (typecase list
+    (null t)
+    (cons (well-formed-list-p (cdr list)))
+    (t    nil)))
 
 (defun print-indentation-lossage (&optional (stream *standard-output*))
   "Return the list of symbols whose indentation styles collide incompatibly.





More information about the slime-cvs mailing list