From a260c500ba01a6ed3004cc7cf4ec4fc64fd453e7 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 19 Aug 2006 22:00:01 +0000 Subject: [PATCH 1/1] * scm/lily.scm (lilypond-all): option read-file-list: substitute commandline args with contains, split by \n. * scripts/lilypond-book.py (Lilypond_file_snippet.my_system): write snippet-names file, call with -dread-file-list. Fixes command limitations on 64-bit systems. * scripts/lilypond-book.py (main): add --formats=eps for texinfo/latex. --- ChangeLog | 9 ++++++++- lily/lily-guile.cc | 2 +- lily/lily-parser-scheme.cc | 2 +- lily/main.cc | 1 + scm/lily.scm | 9 +++++++++ scripts/lilypond-book.py | 11 ++++++++++- 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ab9597906..f2746e16ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,17 @@ 2006-08-19 Han-Wen Nienhuys + * scm/lily.scm (lilypond-all): option read-file-list: substitute + commandline args with contains, split by \n. + + * scripts/lilypond-book.py (Lilypond_file_snippet.my_system): + write snippet-names file, call with -dread-file-list. Fixes + command limitations on 64-bit systems. + * input/regression/stencil-color-rotation.ly: new file. * lily/include/translator.hh (struct Acknowledge_information): revert: don't use Protected_scm in global objects, as GUILE can't - handle gc_unprotect from automated destructors. + handle gc_unprotect from automated destructors on MacOS X. * lily/grob.cc (get_print_stencil): use retval.expr() as base for color, not the original stencil. Fixes combinations of diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 26d2d30ac8..f7938cfc21 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -131,7 +131,7 @@ ly_scm2string (SCM str) { assert (scm_is_string (str)); return string (scm_i_string_chars (str), - (int) scm_i_string_length (str)); + (int) scm_i_string_length (str)); } char * diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index 56de47abbd..0e844d2bc0 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -37,7 +37,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", "Upon failure, throw @code{ly-file-failed} key.") { SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string"); - char const *file = scm_i_string_chars (name); + string file = ly_scm2string (name); char const *extensions[] = {"ly", "", 0}; string file_name = global_path.find (file, extensions); diff --git a/lily/main.cc b/lily/main.cc index bfdf01566f..ae4c86dd2a 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -427,6 +427,7 @@ main_with_guile (void *, int, char **) *tail = scm_cons (scm_makfrom0str (arg), SCM_EOL); tail = SCM_CDRLOC (*tail); } + delete option_parser; option_parser = 0; diff --git a/scm/lily.scm b/scm/lily.scm index 7ed892cc40..79b060ec70 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -42,6 +42,7 @@ similar to chord syntax") "dump GC protection info") (show-available-fonts #f "List font names available.") + (read-file-list #f "Read files to be processed from command line arguments") ))) @@ -390,6 +391,14 @@ The syntax is the same as `define*-public'." (exit 0))))) (define-public (lilypond-all files) + (if (ly:get-option 'read-file-list) + (set! files + (filter (lambda (s) + (> (string-length s) 0)) + (apply append + (map (lambda (f) (string-split (ly:gulp-file f) #\nl)) + files))) + )) (if (ly:get-option 'show-available-fonts) (begin diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index ddde74ae97..9e2932113f 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -134,6 +134,7 @@ def get_option_parser (): p.add_option ('-f', '--format', help=_('''use output format FORMAT (texi [default], texi-html, latex, html)'''), action='store') + p.add_option ("-I", '--include', help=_('add DIR to include path'), metavar="DIR", action='append', dest='include_path', @@ -1381,7 +1382,11 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets): my_system ('latex %s.texstr' % l) if ly_names: - my_system (string.join ([cmd, 'snippet-map.ly'] + ly_names)) + open ('snippet-names', 'w').write ('\n'.join (['snippet-map.ly'] + + ly_names)) + + my_system (string.join ([cmd, 'snippet-names'])) + LATEX_INSPECTION_DOCUMENT = r''' \nonstopmode @@ -1716,9 +1721,13 @@ def main (): and global_options.create_pdf): global_options.process_cmd += "--pdf -deps-font-include -dgs-font-load " + if global_options.verbose: global_options.process_cmd += " --verbose " + + global_options.process_cmd += " -dread-file-list " + identify () try: -- 2.39.2