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).

Reply via email to