commit c9c9e71329376dc1f7f647751e03bf24e628b148 parent 89076684faab07f9285a51b247e253ce094c560d Author: Tomas Hlavaty <tom@logand.com> Date: Fri, 29 Apr 2011 00:48:18 +0200 M-. works with built-in functions Diffstat:
M | swank-picolisp.l | | | 24 | +++++++++++++++++------- |
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/swank-picolisp.l b/swank-picolisp.l @@ -98,22 +98,28 @@ (de *Swank:autodoc-built-in . NIL) -(de %swank:autodoc-built-in (Nm) - (unless *Swank:autodoc-built-in ## TODO determine src directory? +(de %swank:ensure-autodoc-built-in () + (unless *Swank:autodoc-built-in (in (list "sh" "-c" (pack "grep -n '# (' " (path "@") - "src64" + "src64" ## TODO determine src directory? "/*.l | grep -v '# (c)'" ) ) (use (@A @B) (until (eof) - ## /home/tomas/git/picolisp/src64/sym.l:# (fold 'any ['cnt]) -> sym (when (match '(@F ":" @N ":" "#" " " "(" @A " " @Z) (line)) ## TODO multiple lines, e.g.'for' (push '*Swank:autodoc-built-in - (list (pack @A) (pack @Z) (pack @F) (format (pack @N))) ) ) ) ) ) ) + (list + (pack @A) + (pack @Z) + (pack @F) + (format (pack @N)) ) ) ) ) ) ) ) ) + +(de %swank:autodoc-built-in (Nm) + (%swank:ensure-autodoc-built-in) (let? X (cadr (assoc Nm *Swank:autodoc-built-in)) (pack "(" X) ) ) @@ -163,8 +169,12 @@ ) (de swank:find-definitions-for-emacs (Nm) - ## TODO how to find where sym defined? - ) + (%swank:ensure-autodoc-built-in) + (let? X (assoc Nm *Swank:autodoc-built-in) + (list (list Nm (list ':location + (list ':file (caddr X)) + (list ':line (cadddr X)) + () ) ) ) ) ) (de swank:swank-toggle-trace (Nm) (trace (intern Nm)))