On 19/11/2019 15:39, Aaron Hill wrote:
On 2019-11-19 3:37 am, Matt Wallis wrote:
I want to pass the subtitle into lilypond on the command line because
it is also required by other programmes (e.g. sox needs the subtitle
to create a tag for the mp3 it creates).
[ . . . ]
But I now get the warning:
Parsing...WARNING: #f: imported module (guile-user) overrides core
binding `%module-public-interface'
Should I be concerned? Is it safe to ignore? Can I suppress this warning?
With a little more work, you can peek into the guile-user module and
grab out what you need without importing the entire module into the
current environment:
%%%%
\version "2.19.83"
#(define (guile-user-lookup sym def)
(let ((mod (resolve-module '(guile-user))))
(if (module-defined? mod sym) (eval sym mod) def)))
#(format #t "\nHello, ~a!" (guile-user-lookup 'hello "..."))
%%%%
Very interesting! Thank Aaron.
So, I have added the line (in place of your call to format):
subtitle = #(guile-user-lookup 'subtitle "...")
in order to get back into the world of lilypond variables, and it all
works. Without this line I get:
$ lilypond -e '(define subtitle "One Two Three")' SatbScore.ly
GNU LilyPond 2.19.83
Processing `SatbScore.ly'
Parsing...
SatbScore.ly:16:22: error: unknown escaped string: `\subtitle'
\header { subtitle =
\subtitle }
A possibly related question ... the lilypond docs use `define-public`,
and you use `define`. What is the difference?