Noeck <[email protected]> writes:
> Hi all,
>
> I have a wish for a scheme function integrated in LilyPond:
> A function that returns the short form of the version used: e.g. 2.18
> (and not 2.18.0)
>
>
> I don’t know if that already exists, I couldn’t find it anywhere. The
> reason why I want this function is below. It would be very easy to
> implement: In scm/lily.scm after the definition of lilypond-version, one
> could add:
>
> (define-safe-public (lilypond-short-version) ; or short-lilypond-version
> (string-join
> (map (lambda (x) (if (symbol? x)
> (symbol->string x)
> (number->string x)))
> (list-head (ly:version) 2))
> "."))
>
>
> What for?
> For a custom tagline like: Lilypond 2.18
dak@lola:/usr/local/tmp/lilypond$ lilypond scheme-sandbox
GNU LilyPond 2.19.0
Processing `/usr/local/share/lilypond/2.19.0/ly/scheme-sandbox.ly'
Parsing...
guile> (format "LilyPond ~:@{~a.~a~}" (ly:version))
"LilyPond 2.19"
guile> (exit)
Success: compilation successfully completed
dak@lola:/usr/local/tmp/lilypond$
That does not really require a command of its own.
> Why integrated?
You'll likely be writing a format string anyway.
--
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user