Take 2 on adding eldoc support to SLIME. Things to note:
- support for GNU version >= 21.3 using hook ``eldoc-print-current-symbol-info-function''; older versions use advice. - 2 approaches to caching arglist lookups; see variable ``slime-cache-type'' for details. - avoids interning symbols when looking for functions that don't exist. - function ``slime-documentation'' to display documentation rather than description for thing-at-point.
Try it out! Comments welcome.
/s
It works great for me, except for one thing: it always looks up symbols in the cl-user package, even when slime knows the source is in a different one. Other than that, it's good stuff!
I still have some reservations about using eldoc (mainly because the hook you use is very recent, and defadvise seems a little kludgy to me) when what it does here is I think can be recreated in around 40 lines (over which we have complete control). But I'll soon get over it :-)
One more thing in connection with this: is tracking the current package in the *inferior-lisp* buffer planned for slime?
Andras
"Sean O'Rourke" sorourke@cs.ucsd.edu writes:
Take 2 on adding eldoc support to SLIME. Things to note:
- support for GNU version >= 21.3 using hook ``eldoc-print-current-symbol-info-function''; older versions use advice.
- 2 approaches to caching arglist lookups; see variable ``slime-cache-type'' for details.
- avoids interning symbols when looking for functions that don't exist.
- function ``slime-documentation'' to display documentation rather than description for thing-at-point.
Try it out! Comments welcome.
Groovy!
I've committed this, but I hacked it a bit - particularly I took out the use of eldoc in favour of post-command-hook. The advice and version-specific tests give me the willies, since supporting Emacs20, Emacs21, and XEmacs 21 is already a fair bit of work and I don't want to tempt fate by relying on internal details :-)
Now there's a function `slime-autodoc' that is called after every Emacs command in a slime-mode buffer (but only if `slime-autodoc-mode' is set to non-nil), and its job is to try to print some useful information. Currently it prints the arglist of any function-call at point.
Is this equivalent to what we got from eldoc, or did I miss something?
Anyway, my version isn't perfect, but it's integrated and should serve as a foothold for further hacking. One nice thing that eldoc does and this doesn't is to distinguish between function and variable references in the source to lookup the appropriate documentation - very nice.
Cheers, Luke
On Thu, 6 Nov 2003, Luke Gorrie wrote:
Is this equivalent to what we got from eldoc, or did I miss something?
Eldoc (and also the hack I posted a few days ago) is a bit less agressive: there's a delay before it tries to get/print the arglist. The good things about that are less overhead (e.g. when point is moving fast in a source buffer) and a chance to look at other messages.
Andras