Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

slime custom configuration help

23 views
Skip to first unread message

Michael Graffam

unread,
Dec 9, 2021, 12:05:03 PM12/9/21
to
Hello everyone,

I am using SLIME & SBCL on a remote host. I essentially use Emacs/Slime as a client to connect to my Lisp system, using M-x slime-connect.

I'd like to configure things so that when I connect via SLIME, I can run my own function in the remote Lisp before getting a REPL prompt.

Is that possible?

Tom Russ

unread,
Dec 9, 2021, 1:52:19 PM12/9/21
to
Is this something you could do with a lisp init file that the remote SBCL job executes on startup?

Or do you want to do this only based on the slime connection?

Madhu

unread,
Dec 9, 2021, 8:48:23 PM12/9/21
to

* Tom Russ <e0c2d025-2bf6-4425-99b8-8de8440ebf3cn @googlegroups.com> :
Wrote on Thu, 9 Dec 2021 10:52:15 -0800 (PST):

> On Thursday, December 9, 2021 at 9:05:03 AM UTC-8, michael???@gmail.com wrote:
>> I am using SLIME & SBCL on a remote host. I essentially use
>> Emacs/Slime as a client to connect to my Lisp system, using M-x
>> slime-connect.
>>
>> I'd like to configure things so that when I connect via SLIME, I can
>> run my own function in the remote Lisp before getting a REPL prompt.
>>
>> Is that possible?
>
> Is this something you could do with a lisp init file that the remote
> SBCL job executes on startup?

There is such a file - I think it is ~/.swank.lisp - it is loaded when
swank is initialized and called through "swank-loader.lisp"

details are in the info-manual under "Customization" "Lisp Side"

For sly it is ~/.slynk.lisp - and I think this was extended to work even
if you loaded sly through some other means (other than "slynk-loader")

Michael Graffam

unread,
Dec 17, 2021, 3:48:16 PM12/17/21
to
Yeah, none of that will actually achieve what I'd like to do.

I'd like to run a function on actual connection .. not when Lisp or Swank individually are loaded.

The use-case is to allow Emacs / SLIME to be used as an interface for a Lisp application. I can make Emacs automatically connect.
But then the user has to manually start the program. It would be nice to have it simply run on connect.

Siebe de Vos

unread,
Dec 17, 2021, 8:31:38 PM12/17/21
to
This is what I have more or less, without any warranty:

(defun my-hook-function ()
(slime-rex ()
('(swank-repl::eval-region
"(progn (server-side-function)
(format t \"It worked\")
(values))"))
((:ok result))))

(add-hook 'slime-connected-hook 'my-hook-function t)
0 new messages