lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Location of guile socket Linux


From: Jean Abou Samra
Subject: Re: Location of guile socket Linux
Date: Tue, 12 Apr 2022 19:41:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

Hi Kenneth,

Le 11/04/2022 à 12:43, Kenneth Flak a écrit :
Hi list,

First time poster here, just starting to get my head around using
lilypond together with scheme/guile! I use nvim, and I would love to be
able to use this together with the scheme-playground.

I guess you mean scheme-sandbox?

For this I would
need to know where to find and connect to the socket that guile is
creating, but I haven't got the foggiest idea where this is located. For
a vanilla guile setup I use this script:

#!/usr/bin/env bash

set -xe

SOCKET=$(git rev-parse --show-toplevel)/.guile-repl.socket
if -f $SOCKET; then rm $SOCKET; fi
guile --listen=$SOCKET
rm $SOCKET

which allows me to run :ConjureConnect .guile-repl.socket from the same
directory and get a REPL from within nvim. Theoretically this should be
possible to achieve simply by starting a scheme-playground in a
terminal, and connect to this one manually from nvim.


I was about to suggest the below (working in Guile 2, which means
it requires a recent 2.23 version unless you use some distribution
that was shipping 2.22 with Guile 2), but it turns out that our official
installers have a Guile that is compiled with --disable-networking, so
it won't work. You'd have to compile LilyPond for yourself. If that
doesn't scare you away, here you go ...

\version "2.23.8"

#(use-modules (system repl server)
              (ice-9 popen)
              (ice-9 rdelim))

#(let* ((port (open-input-pipe "git rev-parse --show-toplevel"))
        (git-repo (read-line port)))
   (close-pipe port)
   (let ((socket-path (string-append git-repo "/.guile-repl.socket")))
     (system (string-append "rm " socket-path))
     (let ((socket (make-unix-domain-server-socket #:path socket-path)))
       (run-server socket))))


This should be put in a file that you then compile, just like
"lilypond scheme-sandbox" compiles the file "scheme-sandbox.ly"
in LilyPond's internal paths.

Jean




reply via email to

[Prev in Thread] Current Thread [Next in Thread]