lilypond-devel
[Top][All Lists]
Advanced

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

clone-parser: output_basename_ copy?


From: Nicolas Sceaux
Subject: clone-parser: output_basename_ copy?
Date: Thu, 25 Aug 2005 11:55:29 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

Hi,

In order to automate some stuff in a book with lots of scores, with one
file per score block, located in various directories, I've tried the
following:

#(ly:parser-parse-string (ly:clone-parser parser)
                         "\\include \"foo.ly\""))

[the idea is to make a function that builds the "\\include \"foo.ly\""
string]

However, the output PostScript file is then called `.ps', and the PDF
file is named `..pdf'. The reason I guess is that the cloned parser does
not have its output_basename_ slot set.

I also tried the following:

#(display (ly:parser-output-name parser))
#(ly:parser-parse-string (ly:clone-parser parser)
                         "\\include \"foo.ly\""))
#(display (ly:parser-output-name parser))

and curiously enough, it shows that after parser-parse-string, `parser'
does not have an output name anymore, which explains the `.ps' output
file name.

By applying the following patch, the output file name was as expected:

--- lily-parser.cc.~1.51.~      2005-08-22 16:49:23.000000000 +0200
+++ lily-parser.cc      2005-08-24 19:04:57.000000000 +0200
@@ -42,6 +42,7 @@
   sources_ = src.sources_;
   default_duration_ = src.default_duration_;
   error_level_ = src.error_level_;
+  output_basename_ = src.output_basename_;
 
   smobify_self ();
   if (src.lexer_)

Do you see a reason why it would be a bad idea to copy the
output_basename_ slot when cloning a parser?

nicolas




reply via email to

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