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

Robert Strandh rstrandh at common-lisp.net
Wed Jul 13 05:25:45 UTC 2005


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

Modified Files:
	lisp-syntax.lisp 
Log Message:
Indentation for `cond'.

Date: Wed Jul 13 07:25:44 2005
Author: rstrandh

Index: climacs/lisp-syntax.lisp
diff -u climacs/lisp-syntax.lisp:1.12 climacs/lisp-syntax.lisp:1.13
--- climacs/lisp-syntax.lisp:1.12	Tue Jul 12 08:01:59 2005
+++ climacs/lisp-syntax.lisp	Wed Jul 13 07:25:44 2005
@@ -1289,6 +1289,20 @@
 	  (t
 	   (indent-form syntax (elt (children tree) (car path)) (cdr path))))))
 
+(define-list-indentor indent-clause indent-form)
+
+(defmethod compute-list-indentation
+    ((syntax lisp-syntax) (symbol (eql 'cond)) tree path)
+  (if (null (cdr path))
+      ;; top level
+      (if (= (car path) 2)
+	  ;; after `cond' 
+	  (values tree 2)
+	  ;; indent like the first clause
+	  (values (elt (children tree) 2) 0))
+      ;; inside a clause
+      (indent-clause 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