[climacs-cvs] CVS climacs

thenriksen thenriksen at common-lisp.net
Thu Feb 9 15:26:08 UTC 2006


Update of /project/climacs/cvsroot/climacs
In directory common-lisp:/tmp/cvs-serv29045

Modified Files:
	lisp-syntax.lisp 
Log Message:
Added methods to indent conditional reader forms.


--- /project/climacs/cvsroot/climacs/lisp-syntax.lisp	2006/02/07 17:51:36	1.44
+++ /project/climacs/cvsroot/climacs/lisp-syntax.lisp	2006/02/09 15:26:08	1.45
@@ -1825,6 +1825,25 @@
 	 (values (elt-form (children tree) (1- (car path))) 0))
 	(t (indent-form syntax (elt-form (children tree) (car path)) (cdr path)))))
 
+;; FIXME: The next two methods are basically identical to the above definition, 
+;; something should be done about this duplication.
+
+(defmethod indent-form ((syntax lisp-syntax) (tree reader-conditional-positive-form) path)
+  (cond ((or (null path)
+	     (and (null (cdr path)) (zerop (car path))))
+	 (values tree 0))
+	((null (cdr path))
+	 (values (elt-form (children tree) (1- (car path))) 0))
+	(t (indent-form syntax (elt-form (children tree) (car path)) (cdr path)))))
+
+(defmethod indent-form ((syntax lisp-syntax) (tree reader-conditional-negative-form) path)
+  (cond ((or (null path)
+	     (and (null (cdr path)) (zerop (car path))))
+	 (values tree 0))
+	((null (cdr path))
+	 (values (elt-form (children tree) (1- (car path))) 0))
+	(t (indent-form syntax (elt-form (children tree) (car path)) (cdr path)))))
+
 (defmethod indent-form ((syntax lisp-syntax) (tree list-form) path)
   (if (= (car path) 1)
       ;; before first element




More information about the Climacs-cvs mailing list