[climacs-cvs] CVS update: climacs/lisp-syntax.lisp

Robert Strandh rstrandh at common-lisp.net
Tue Jul 12 05:47:40 UTC 2005


Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv26552

Modified Files:
	lisp-syntax.lisp 
Log Message:
Indentation for `defmethod' which recognizes method qualifiers.

Date: Tue Jul 12 07:47:39 2005
Author: rstrandh

Index: climacs/lisp-syntax.lisp
diff -u climacs/lisp-syntax.lisp:1.10 climacs/lisp-syntax.lisp:1.11
--- climacs/lisp-syntax.lisp:1.10	Mon Jul 11 11:19:15 2005
+++ climacs/lisp-syntax.lisp	Tue Jul 12 07:47:39 2005
@@ -1270,6 +1270,24 @@
 	 ;; in the options or method specifications
 	 (indent-list syntax (elt (children tree) (car path)) (cdr path))))))
 
+(defmethod compute-list-indentation
+    ((syntax lisp-syntax) (symbol (eql 'defmethod)) tree path)
+  (let ((lambda-list-pos (position-if (lambda (x) (typep x 'list-form))
+				      (children tree))))
+    (cond ((null (cdr path))
+	   ;; top level
+	   (values tree (if (or (null lambda-list-pos)
+				(<= (car path) lambda-list-pos))
+			    4
+			    2)))
+	  ((or (null lambda-list-pos)
+	       (< (car path) lambda-list-pos))
+	   (indent-list syntax (elt (children tree) (car path)) (cdr path)))
+	  ((= (car path) lambda-list-pos)
+	   (indent-lambda-list syntax (elt (children tree) (car path)) (cdr path)))
+	  (t
+	   (indent-form syntax (elt (children tree) (car path)) (cdr path))))))
+
 (defun compute-path-in-trees (trees n offset)
   (cond ((or (null trees)
 	     (>= (start-offset (car trees)) offset))    




More information about the Climacs-cvs mailing list