[lice @ massive rearrangement to get rid of compiler warnings and mimic the file...
[lice.git] / help.lisp
blob75c71d62cc92ee073f1a4e89c97e244fc8188419
1 ;;; Documentation and help related commands
3 (in-package "LICE")
5 (defcommand describe-symbol ()
6 "Display the full documentation of a symbol."
7 (let* ((pkgs (mapcar (lambda (p)
8 (cons (package-name p) p))
9 (list-all-packages)))
10 (pkg (cdr (find (completing-read "Package: " pkgs) pkgs :key 'car :test 'string-equal)))
11 (symbols (loop for s being each present-symbol of pkg
12 collect s))
13 (symbol (find-symbol (string-upcase (completing-read "Symbol: " symbols)) pkg)))
14 (with-current-buffer (get-buffer-create "*Help*")
15 (erase-buffer)
16 (insert (with-output-to-string (out)
17 (describe symbol out)))
18 (pop-to-buffer (current-buffer)))))
21 (provide :lice-0.1/help)