Changeset 6698


Ignore:
Timestamp:
Jun 12, 2007, 12:38:45 PM (17 years ago)
Author:
Gary Byers
Message:

PRINT-SHORT-DOC was a bad


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ide-1.0/ccl/hemlock/src/doccoms.lisp

    r6 r6698  
    107107          (print-command-bindings (command-bindings obj) s)
    108108          (terpri s)
    109           (print-short-doc (command-documentation obj) s))))
     109          (print-doc (command-documentation obj) s))))
    110110    (when vars
    111111      (when coms (terpri s))
     
    120120                (prin1 (variable-value obj) s))
    121121              (terpri s)
    122               (print-short-doc (variable-documentation obj) s))))))
     122              (print-doc (variable-documentation obj) s))))))
    123123    (when attr
    124124      (when (or coms vars) (terpri s))
     
    127127        (let ((obj (getstring att *character-attribute-names*)))
    128128          (write-line att s)
    129           (print-short-doc (character-attribute-documentation obj) s))))))
    130 
    131 ;;; PRINT-SHORT-DOC takes doc, a function or string, and gets it out on stream.
    132 ;;; If doc is a string, this only outputs up to the first newline.  All output
    133 ;;; is preceded by two spaces.
    134 ;;;
    135 (defun print-short-doc (doc stream)
     129          (print-doc (character-attribute-documentation obj) s))))))
     130
     131;;; PRINT-DOC takes doc, a function or string, and gets it out on stream.
     132
     133(defun print-doc (doc stream)
    136134  (let ((str (typecase doc
    137135               (function (funcall doc :short))
    138                (simple-string
    139                 (let ((nl (position #\newline (the simple-string doc))))
    140                   (subseq doc 0 (or nl (length doc)))))
     136               (simple-string doc)
    141137               (t
    142138                (error "Bad documentation: ~S" doc)))))
     
    371367                     (t (write-line str s)
    372368                        (write-string "   - " s)))
    373                (print-short-doc (command-documentation cmd) s))))
     369               (print-doc (command-documentation cmd) s))))
    374370       :mode name))))
    375371                   
Note: See TracChangeset for help on using the changeset viewer.