clone-parser: output_basename_ copy?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

clone-parser: output_basename_ copy?

Nicolas Sceaux
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


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: clone-parser: output_basename_ copy?

Han-Wen Nienhuys
Nicolas Sceaux wrote:

> 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?
>

no, please apply.

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel