[slime-devel] Re: Expand imported symbol with package name

Helmut Eller heller at common-lisp.net
Fri Feb 1 21:52:18 UTC 2008


* Numeromancer [2008-01-30 23:27+0100] writes:

>> > Numeromancer <tschaef at sbcglobal.net> writes:
>> > 
>>> >> Does slime have a function which will qualify the symbol at point with
>>> >> its package name if it is imported?  And the obvious extension,
>>> >> qualifying all symbols in the region or file?  Does anyone have any
>>> >> hints on how one might create such a function?

No, Slime has no such command.

[...]
> Perhaps "imported" is not technically correct. "Available in the current
> package without qualification" might be better.  Or not.
>
> I mean this: if I am in package foo, which uses cl, for example, then
>
> (map 'func-in-foo (list 1 2 3 var-in-foo))
>
> would be transformed to
>
> (cl:map 'func-in-foo (cl:list 1 2 3 var-in-foo))
>
> if the whole expression were in the region.  The symbols in the current
> package are not qualified.  Or, the package name is an argument and only
> symbols in that package are so qualified.

Would you like to implement something like this?

Sending the region (as string) and the name of the current package to
the Lisp process is very easy.  Perhaps it's good enough to READ the
region in the package (or perhaps some temporary package with suitable
imports) and pprint the form with clever printer settings.  Sending the
printed result back and inserting it in the buffer is also easy.

Helmut.




More information about the slime-devel mailing list