]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #404
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 18 Aug 2007 04:57:27 +0000 (01:57 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 18 Aug 2007 04:57:27 +0000 (01:57 -0300)
Mix output-suffix into output filename, and document.

Documentation/user/running.itely
scm/lily-library.scm

index 10aec0a9f0d6eeaf96da890e5758993d0cd87c1c..34eca21c202eb9af69c60b9a7938fe159cbb9f80 100644 (file)
@@ -61,6 +61,21 @@ they will each be processed independently.  @footnote{The status of
 GUILE is not reset after processing a @code{.ly} file, so be careful
 not to change any system defaults from within Scheme.}
 
+In addition, the value of @code{output-suffix} will be inserted between
+the basename and the number.  An input file containing 
+
+@example
+#(define output-suffix "violin")
+\book @{ @dots{} @} 
+#(define output-suffix "cello")
+\book @{ @dots{} @} 
+@end example
+
+@noindent
+will output @var{base}@file{-violin.ps} and
+@var{base}@file{-cello-1.ps}.
+
+
 
 @subsection Command line options
 
index 068bbb2873688b478fd0cd31ca75a0200ab5bc1b..c925a808f17c0704598ccd452e38bd7432f256c3 100644 (file)
   (let*
       ((paper (ly:parser-lookup parser '$defaultpaper))
        (layout (ly:parser-lookup parser '$defaultlayout))
-
        (count (ly:parser-lookup parser 'output-count))
-       (base (ly:parser-output-name parser)))
+       (base (ly:parser-output-name parser))
+       (output-suffix (ly:parser-lookup parser 'output-suffix)) )
+
+    (if (string? output-suffix)
+       (set! base (format "~a-~a" base (string-regexp-substitute
+                                          "[^a-zA-Z0-9-]" "_" output-suffix))))
 
     ;; must be careful: output-count is under user control.
     (if (not (integer? count))
 
     (if (> count 0)
        (set! base (format #f "~a-~a" base count)))
-
     (ly:parser-define! parser 'output-count (1+ count))
     (process-procedure book paper layout base)
     ))