Hi Han-Wen, On 15/12/11 12:48, Han-Wen Nienhuys wrote: > On Wed, Dec 14, 2011 at 12:51 AM, Ian Hulin <[email protected]> wrote: > >> In order to get the markup stuff to compile or be interpreted >> correctly with Guile V2, I had to get the procedures validating the >> markup commands to look in a single module at the list where they were >> held. So I chose the base (lily) module. > >> To keep it consistent, I got >> the define-markup-command and define-markup-list-command macros to >> push and pop the current Scheme module by doing >> (let (prevmod (current-module)) >> (existing declaration) >> ... > > Does this mean that markup definitions in user code (ie. in .ly files) > will be put in the lily module too? How will you prevent definitions > from leaking between files? > You mean in the case of something like $ lilypond gibbon.ly vole.ly aardvark.ly where gibbon.ly has #(define-markup-command (bananas layout properties markup?) blah ...) vole.ly and aardvark.ly would still be able code \markup \bananas ... and they would pick up the definition from gibbon.ly.
Mao. You're right. > Why can't the validation procedure look in multiple places? > Because this means serious fiddling with the maoing markup code. I really hope you didn't write it because I agree with David, it's a fetid pile of Dingo's kidneys to maintain, and I fear it'll take me a lo-o-o-ong time and much cursing and swearing to change it. It'll mean trying to find a way of getting compile-markup-expression to look in a list both in the current module, and then falling back to the (lily) module (where all the base code markup commands from define-markup-commands.scm will be) before failing the validation. > If it needs to be one place, it should probably be the scope of the > .ly file, with some initialization importing the definitions from the > lily module. > You mean: 1. do some icky stuff in the lilypond-file procedure to create a new lilypond scope, then make sure it (use-modules (lily)) before letting ly:parse-file loose in it? 2. have compile-markup-expression do a double lookup in (current-module), and if needed then look in (lily)? Worth a punt, Cheers, Ian _______________________________________________ lilypond-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-devel
