commit 4a5870c52deef2f623c3de8cd20981ae4e6b4262 parent f949275909b39a3e264b1a07381012e75955951c Author: Tomas Hlavaty <tom@logand.com> Date: Sat, 30 Apr 2011 15:54:54 +0200 swank:describe-symbol refactoring Diffstat:
M | swank-picolisp.l | | | 43 | ++++++++++++++++++++++++++----------------- |
1 file changed, 26 insertions(+), 17 deletions(-)
diff --git a/swank-picolisp.l b/swank-picolisp.l @@ -236,10 +236,10 @@ (de swank:swank-expand-1 (Form) Form ) -(de *Swank:xref . NIL) +(de *Swank:ref . NIL) -(de %swank:ensure-xref () - (setq *Swank:xref ## TODO really compute +(de %swank:ensure-ref () + (setq *Swank:ref ## TODO really compute (mapcar pack '( ## Symbol Functions new sym str char name sp? pat? fun? all intern extern ==== qsym loc box? str? ext? touch zap length size format chop pack glue pad align center text wrap pre? sub? low? upp? lowc uppc fold val getd set setq def de dm recur undef redef daemon patch xchg on off onOff zero one default expr subr let let? use accu push push1 pop cut del queue fifo idx lup cache locale dirname @@ -270,21 +270,30 @@ ## Globals NIL *OS *DB T *Solo *PPid *Pid @ @@ @@@ This *Dbg *Zap *Scl *Class *Dbs *Run *Hup *Sig1 *Sig2 ^ *Err *Msg *Uni *Led *Tsm *Adr *Allow *Fork *Bye ) ) ) ) +(de swank-ref-file (Nm) + (pack + (path "@doc/ref") + (let X (chop Nm) + (cond + ((= "*" (car X)) + (uppc (cadr X)) ) + ((member (lowc (car X)) (chop "abcdefghijklmnopqrstuvwxyz")) + (uppc (car X)) ) + (T "_") ) ) + ".html" ) ) + (de swank:describe-symbol (Nm) - (%swank:ensure-xref) - ## TODO display actual content of the link - (pack "TODO swank:describe-symbol " Nm " " - (when (member Nm *Swank:xref) - (pack "file://" (path "@") "doc/ref" - (let X (chop Nm) - (cond - ((= "*" (car X)) - (uppc (cadr X)) ) - ((member (lowc (car X)) - (chop "abcdefghijklmnopqrstuvwxyz") ) - (uppc (car X)) ) - (T "_") ) ) - ".html#" Nm ) ) ) ) + (ifn (member Nm (%swank:ensure-ref)) + (pack "Unknown symbol '" Nm "'") + (let File (swank-ref-file Nm) + (let Url (pack "file://" File "#" Nm) + (glue "^J" ## TODO turn of ^J escaping! + (make + (link (pack "Symbol '" Nm "' " Url)) + ## (in File ## TODO filter requested content and render html + ## (until (eof) + ## (link (line)) ) ) + (link "TODO display actual content of the link") ) ) ) ) ) ) (de swank:init-inspector (Form) )