Update of /project/mcclim/cvsroot/mcclim/Apps/Inspector In directory common-lisp.net:/tmp/cvs-serv3338
Modified Files: inspector.lisp Log Message: Fixed a bunch of little bugs. Added some comments. Package display was ugly in one place I forgot to change earlier, so I changed it. Numbers and strings had some weird display problems, which I've mostly fixed (and I can only hope that I didn't introduce minor bugs in some other part of the program). I think this is ready for the Mothering Sunday release!
Date: Fri Mar 4 22:32:09 2005 Author: pscott
Index: mcclim/Apps/Inspector/inspector.lisp diff -u mcclim/Apps/Inspector/inspector.lisp:1.22 mcclim/Apps/Inspector/inspector.lisp:1.23 --- mcclim/Apps/Inspector/inspector.lisp:1.22 Wed Feb 16 00:12:07 2005 +++ mcclim/Apps/Inspector/inspector.lisp Fri Mar 4 22:32:08 2005 @@ -304,9 +304,10 @@ (formatting-cell (pane) (inspect-object car pane)))))))
(defmethod inspect-object ((object cons) pane) + ;; Decide how to display the cons by looking in cons-cell-dico (if (gethash object (cons-cell-dico *application-frame*)) - (inspect-cons-as-cells object pane) - (inspect-cons-as-list object pane))) + (inspect-cons-as-cells object pane) + (inspect-cons-as-list object pane)))
(defmethod inspect-object-briefly ((object hash-table) pane) @@ -383,9 +384,13 @@ (print-documentation object pane)))
(defmethod inspect-object-briefly ((object package) pane) + ;; Display as 'Package: "PACKAGE-NAME"'. We're doing something a + ;; little unusual here by not bolding the "Package:" part. This may + ;; be a tad inconsistent, but the other way looks very odd. (with-output-as-presentation (pane object (presentation-type-of object)) (format pane "Package: ~S" (package-name object)))) + (defmethod inspect-object ((object package) pane) (inspector-table (format pane "Package: ~S" (package-name object)) @@ -408,7 +413,8 @@ (inspector-table-row (princ "Uses:") (dolist (uses (package-use-list object)) - (inspect-object uses pane))))) + (fresh-line pane) + (inspect-object uses pane)))))
(defmethod inspect-object ((object vector) pane) (with-output-as-presentation @@ -423,15 +429,27 @@ (formatting-cell (pane) (princ ")" pane))))))
+;; For some strange reason, objects that are displayed with PRINT are +;; slightly wider than those displayed with PRIN1. Generally, PRIN1 is +;; what you want, and to prevent strings and numbers from getting +;; slightly wider when they're toggled to full inspection, the +;; INSPECT-OBJECT methods for them call the INSPECT-OBJECT-BRIEFLY +;; methods which do the right thing. (defmethod inspect-object-briefly ((object string) pane) (with-output-as-presentation (pane object (presentation-type-of object)) - (print object))) + (prin1 object))) + +(defmethod inspect-object ((object string) pane) + (inspect-object-briefly object pane))
(defmethod inspect-object-briefly ((object number) pane) (with-output-as-presentation (pane object (presentation-type-of object)) - (print object))) + (prin1 object))) + +(defmethod inspect-object ((object number) pane) + (inspect-object-briefly object pane))
(defun inspect-complex (object pane) "Inspect a complex number. Since complex numbers should be inspected