• slime custom configuration help

    From Michael Graffam@21:1/5 to All on Thu Dec 9 09:05:00 2021
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tom Russ@21:1/5 to michael...@gmail.com on Thu Dec 9 10:52:15 2021
    On Thursday, December 9, 2021 at 9:05:03 AM UTC-8, michael...@gmail.com wrote:
    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?

    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Madhu@21:1/5 to All on Fri Dec 10 07:18:43 2021
    * 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")

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael Graffam@21:1/5 to All on Fri Dec 17 12:48:13 2021
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Siebe de Vos@21:1/5 to Michael Graffam on Sat Dec 18 02:31:34 2021
    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)



    On 17/12/2021 21.48, Michael Graffam wrote:
    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.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)