r3564: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 5 Dec 2002 19:15:17 +0000 (19:15 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 5 Dec 2002 19:15:17 +0000 (19:15 +0000)
mop.lisp
views.lisp

index 37d3da8a642ccc21f2025173d9f58743bdbed76c..f7f7ae02ed5d0c287197c21f80ae5ad15f686800 100644 (file)
--- a/mop.lisp
+++ b/mop.lisp
@@ -11,7 +11,7 @@
 ;;;; in Text, HTML, and XML formats. This includes hyperlinking
 ;;;; capability and sub-objects.
 ;;;;
-;;;; $Id: mop.lisp,v 1.5 2002/12/02 15:57:17 kevin Exp $
+;;;; $Id: mop.lisp,v 1.6 2002/12/05 19:15:02 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
 ;;;;
 (defun finalize-documentation (cl)
   "Calculate class documentation slot"
   (awhen (slot-value cl 'title)
-        (setf (slot-value cl 'title) (car it)))
+        (setf (slot-value cl 'title)
+              (etypecase (slot-value cl 'title)
+                  (cons (car it))
+                  ((or string symbol) it))))
   (awhen (slot-value cl 'description)
-        (setf (slot-value cl 'description) (car it)))
-  
+        (setf (slot-value cl 'description)
+              (etypecase (slot-value cl 'description)
+                  (cons (car it))
+                  ((or string symbol) it))))
+
   (let ((*print-circle* nil))
     (setf (documentation (class-name cl) 'class)
       (format nil "Hyperobject~A~A~A~A"
 (defun hyperobject-class-fields (obj)
   (class-slots (class-of obj)))
 
+(defun hyperobject-class-print-slots (obj)
+  (slot-value (class-of obj) 'print-slots))
+
 (defun hyperobject-class-fmtstr-html-ref (obj)
   (slot-value (class-of obj) 'fmtstr-html-ref))
 
index f6f052f9c23e2e821c3ac6ff8e0ffa892e458e3c..d994e4d0363a413daa6d46690750cc65f4119fc4 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: views.lisp,v 1.7 2002/12/05 18:31:36 kevin Exp $
+;;;; $Id: views.lisp,v 1.8 2002/12/05 19:15:02 kevin Exp $
 ;;;;
 ;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg
 ;;;;
     
     ;; make list of hyperlink link fields for printing to refstr template
     (dolist (ref (hyperobject-class-hyperlinks x))
-      (let ((link-start 
-            (make-link-start x (link-ref fmt) (name ref) (lookup ref)
-                             (nth (position (name ref)
-                                            (slot-value x 'print-slots))
-                                  field-values)  
-                             (append (link-parameters ref) refvars)))
-           (link-end (make-link-end x (link-ref fmt) (name ref))))
-       (push link-start refvalues)
-       (push link-end refvalues)))
+      (let ((print-pos (position (name ref) (hyperobject-class-print-slots x))))
+       (when print-pos
+         (let ((link-start (make-link-start x (link-ref fmt) (name ref) (lookup ref)
+                                            (nth print-pos field-values)
+                                            (append (link-parameters ref) refvars)))
+               (link-end (make-link-end x (link-ref fmt) (name ref))))
+           (push link-start refvalues)
+           (push link-end refvalues)))))
     (setq refvalues (nreverse refvalues))
-    
     (apply #'format s refstr refvalues)))
 
 (defgeneric obj-data (obj))