Update of /project/mcclim/cvsroot/mcclim/Apps/Inspector In directory common-lisp.net:/tmp/cvs-serv27378
Modified Files: inspector.lisp Log Message: Fixed problems with PRINT-DOCUMENTATION, which turned out to be more complicated than I thought. It should work on ACL now.
Date: Sat Apr 2 20:03:59 2005 Author: pscott
Index: mcclim/Apps/Inspector/inspector.lisp diff -u mcclim/Apps/Inspector/inspector.lisp:1.30 mcclim/Apps/Inspector/inspector.lisp:1.31 --- mcclim/Apps/Inspector/inspector.lisp:1.30 Fri Mar 18 21:51:29 2005 +++ mcclim/Apps/Inspector/inspector.lisp Sat Apr 2 20:03:59 2005 @@ -157,7 +157,11 @@ (formatting-cell (,evaluated-pane) (formatting-table (,evaluated-pane) ,@body)))) - (print-documentation ,evaluated-object ,evaluated-pane))))) + (print-documentation (if (eql (class-of ,evaluated-object) + (find-class 'standard-class)) + ,evaluated-object + (class-of ,evaluated-object)) + ,evaluated-pane)))))
(defmacro inspector-table-row ((pane) left right) "Output a table row with two items, produced by evaluating LEFT and @@ -182,10 +186,15 @@ (princ ,label ,evaluated-pane) (inspect-object ,value ,evaluated-pane)))))))
+;; The error handler shouldn't be necessary, but it works around an +;; ACL bug and shouldn't mess anything up on other lisps. The warning +;; handler is there in case DOCUMENTATION raises a warning, to tell +;; lisp that we don't care and it shouldn't go alarming the user. (defun print-documentation (object pane) "Print OBJECT's documentation, if any, to PANE" - (when (handler-bind ((warning #'muffle-warning)) - (documentation object t)) + (when (handler-case (documentation object t) + (error ()) + (warning ())) (with-heading-style (pane) (format pane "~&Documentation: ")) (princ (documentation object t) pane)))