[slime-devel] [PATCH] add eldoc support
Luke Gorrie
luke at bluetail.com
Tue Nov 4 21:26:12 UTC 2003
"Sean O'Rourke" <sorourke at cs.ucsd.edu> writes:
> This patch lets SLIME support Eldoc (i.e. flashing argument lists in
> the minibuffer). Inspired by semantic/cedet, which does this for
> many languages.
Nice idea! I haven't seen Eldoc before.
Could we use our own `post-command-hook' instead of advising eldoc?
That seems safer to me (in terms of avoiding accidentally getting
elisp-specific information in common lisp buffers). Would it do the
same thing?
I dig Eldoc and I'd like to commit support in SLIME. I have a couple
of requests though. The first is a boring portability issue - Emacs20
doesn't have hashtables, so they're a luxury we can't afford. I think
symbol property lists could be used for the cache instead though. The
next question is - do we need a cache? If so, I'd like to skip the
cache for 'spacebar' arglist lookups, just to make sure it gets
refreshed when needed. Sound ok?
BTW, the fix for the problem Andras mentioned is this:
> + (slime-eval-async
> + `(swank:arglist-string ,symbol-name)
> + (slime-buffer-package)
> + (lexical-let ((symbol-name symbol-name)
Add this line: (show show))
> + (lambda (arglist)
> + (funcall show "%s"
> + (setf (gethash symbol-name slime-arglist-cache)
> + (slime-format-arglist symbol-name arglist)))))))))
This is because `slime-eval-async' returns right away, but queues up
its continuation argument to be funcall'd later when Lisp sends the
result back. So by the time the function is called, all the dynamic
bindings are undone - any variables needed in the continuation have to
be moved into lexical bindings.
Cheers,
Luke
More information about the slime-devel
mailing list