Hello.
Could you add a hook around eval-for-emacs, as show in the attached patch? It would allow maintain custom context for all the slime requests.
My use case is that I have this tool: https://github.com/avodonosov/local-package-aliases. It allows me to say that in my package $a:plist-alist means alexandria:plist-alist
It is portable and in my opinion convenient, but as the aliases are handled by reader macro, slime does not understand tokens like $a:plist-alist, because it can't find package $a. In result slime completion, function arguments hints, go-to-definition doesn't work.
The solution I found is that during evaluation of any slime request, if the package designated by swank::*buffer-package* has alias mapping, I temporary add all these aliases as nicknames to the corresponding packages.
That's why I need a hook around evaluation of every expression received by swank::eval-for-emacs.
With the swank patch applied, I add this hook:
(defun swank-eval-for-emacs-hook (next-fn) (local-package-aliases::call-with-nicknames (local-package-aliases::alias-table-for swank::*buffer-package*) next-fn))
(push 'swank-eval-for-emacs-hook swank::*around-eval-for-emacs-hook*)
and slime completion, go-to-definition, function parameters hints all start working.
Best regards, - Anton
On Tue, Jan 15 2013, Anton Vodonosov wrote:
Hello.
Could you add a hook around eval-for-emacs, as show in the attached patch? It would allow maintain custom context for all the slime requests.
eval-for-emacs is a central and important place. I'm not too keen to execute random third party code there. Sorry.
There is (setf (fdefinition 'eval-for-emacs) ...) if you absolutely must change something there.
Helmut