lilypond-devel
[Top][All Lists]
Advanced

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

[PATCH] Inserting global options in the default init sequence using incl


From: Reinhold Kainhofer
Subject: [PATCH] Inserting global options in the default init sequence using include files (new -duser-init command-line option)
Date: Mon, 26 Jul 2010 14:37:02 +0200
User-agent: KMail/1.13.5 (Linux/2.6.32-23-generic; KDE/4.4.5; i686; ; )

Sometimes, one needs to run several lilypond files with the same global 
options (e.g. removing the tagline, using a particular page size, normalizing 
margins, etc. in particular when you want to insert the resulting images into 
e.g. a presentation).

So far, you could write a global settings file and include that in all of the 
scores. However, if you then want to create the images with a different set of 
global options / page sizes, etc. then you had to change the file manually.

Also note, how lilypond-book needs to modify the input file to remove all 
margins, etc.

Here is a patch that adds a command-line option to insert a given include file 
into the init sequence, right before the file itself it processed:

http://codereview.appspot.com/1901042/show


This allows the user to apply the same set of options/definitions to different
files. In particular,
  lilypond -duser-include=draft.ily file.ly
  lilypond -duser-influce=final.ily
will compile file.ly, but read and execut draft.ily and final.ily before 
file.ly is processed. That way, e.g. global paper changes can be easily done, 
and a file can be run several times, each time with a different user-include 
file containing different settings.

This feature is similar to the --init=DATEI feature, except that --init will
replace the whole init sequence (thus your init file will copy all of 
lilypond's init.ly), while -duser-include will only add some definitions to 
the normal init sequence in init.ly (i.e. the file is included using scheme in 
init.ly).

Internally, I just modify the init.ly file to include the given include file 
using the new ly:parser-include-string scheme function. this happens only, if 
a user-init file is given, of course.

Okay to apply?

Cheers,
Reinhold


-- 
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org



reply via email to

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