lilypond-user
[Top][All Lists]
Advanced

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

Robustly include project-specific scheme files?


From: Reedmace Star
Subject: Robustly include project-specific scheme files?
Date: Sun, 21 Oct 2012 23:00:08 +0200
User-agent: KMail/4.8.5 (Linux/3.2.0-32-generic; KDE/4.8.5; x86_64; ; )

Dear LilyPond users,

when working on LilyPond projects that require scheme coding, I
sometimes find it convenient to collect scheme definitions in an
external (but project specific) .scm file.

Currently, I then simply call guile's "load" function to include
it. Typical minimal setup:

--- file my-scheme-defs.scm (same directory as master.ly) ---

;;; scheme definitions...


--- file master.ly ---

\version "2.16.0"
#(load "my-scheme-defs.scm")

%% do something ...

---

This, however, only works when calling lilypond on master.ly from that
same directory. The load command looks for the .scm file in the
present working directory, but not in the directory containing the
including file.

No such restriction applies with the \include command, which works 
exactly as expected. And in fact I like to occasionally compile a .ly 
file from a different directory, usually to collect output files from a 
run with non-standard parameters.

So I'm looking for a reasonably concise method to make this work with
scheme loads, too. One obvious solution would be to shell out '#'
prefixes and put everything into LilyPond include files, but that's
not really pretty, if only because editors do a better job at syntax 
highlighting and indentation with pure scheme files than with embedded 
scheme code.

Is there a better way?

Best regards,

Reedmace Star



reply via email to

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