lilypond-user
[Top][All Lists]
Advanced

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

Re: Old scheme code not working in lilypond 2.25.0


From: Jean Abou Samra
Subject: Re: Old scheme code not working in lilypond 2.25.0
Date: Mon, 16 Jan 2023 00:30:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 16/01/2023 à 00:21, Graham King a écrit :

My first steps into recent versions of lilypond are ruthlessly exposing my ignorant copy-&-paste approach to scheme...

I'm pretty sure that the following code worked fine under lilypond 2.18, but throws errors under 2.25.0:

\version "2.25.0"

% gitver and gitrev (from http://lilypondblog.org/2014/01/why-use-version-control-for-engraving-scores/#more-2151 )
#(use-modules (ice-9 popen))
#(use-modules (ice-9 rdelim))

% NOTE: This function only reads the first line of the command!
#(define (strsystem_internal cmd)
(let* ((port (open-input-pipe cmd))
(str (read-line port)))
(close-pipe port)
str))

#(define-markup-command (strsystem layout props cmd) (markup?)
(interpret-markup layout props
(strsystem_internal cmd)))

gitrev = \markup { \strsystem "/usr/bin/git rev-parse --short HEAD" }

\header {
tagline = \markup{
\line { "Version control for this edition: gitrev " \gitrev }

{ c'}

Under 2.25.0 I get:

Preprocessing graphical objects...

Finding the ideal number of pages...fatal: not a git repository (or any of the parent directories): .git

programming error: Trying to interpret a non-markup object: #<eof>

despite being able to show at the command line that the .ly file really does live in a git repo.

I've tried looking at the usual stuff (guile manual, google) but without profit.  Presumably the code above needs tweaking for guile 2, but I could really use some help, even if it's only a pointer to a convert-guile utility (by analogy with convert-ly).




That does not look like it has anything to do with recent LilyPond versions.
For me, it works. Most likely, LilyPond is not in the right directory
when the file is compiled. For example, if you work under Frescobaldi,
you must save such a file before compiling it, otherwise Frescobaldi
will save it somewhere in /tmp and compile it from there.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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