From 9427bc907eec4647c3e98f70f4962f6e359c0a83 Mon Sep 17 00:00:00 2001
From: janneke <janneke>
Date: Sat, 12 Mar 2005 23:26:58 +0000
Subject: [PATCH] * scm/backend-library.scm (output-scopes, header-to-file):
 Move from framework-tex.scm.

* scm/framework-ps.scm (output-framework)
(output-preview-framework):
* scm/framework-eps.scm (output-classic-framework)
(output-framework): Use it.  Fixes collated files.
---
 ChangeLog                                     | 10 ++++++
 input/les-nereides.ly                         |  1 +
 .../E.Satie/petite-ouverture-a-danser.ly      |  8 +++--
 input/mutopia/F.Schubert/morgenlied.ly        |  2 +-
 input/mutopia/J.S.Bach/bwv940.ly              |  2 +-
 input/mutopia/J.S.Bach/wtk1-fugue2.ly         |  2 +-
 input/mutopia/R.Schumann/romanze-op28-2.ly    |  2 +-
 input/mutopia/W.A.Mozart/mozart-hrn-3.ly      | 36 +++++++++----------
 input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily |  4 +--
 .../W.A.Mozart/mozart-hrn3-romanze.ily        |  2 +-
 .../mutopia/W.A.Mozart/mozart-hrn3-rondo.ily  |  2 +-
 input/test/coriolan-margin.ly                 |  8 +++--
 input/test/dynamic-extra.ly                   |  7 ++--
 input/test/title-markup.ly                    | 14 +++++---
 scm/backend-library.scm                       | 28 +++++++++++++++
 scm/framework-eps.scm                         | 26 ++++++--------
 scm/framework-ps.scm                          |  7 ++--
 scm/framework-tex.scm                         | 28 ---------------
 18 files changed, 103 insertions(+), 86 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 53836e2229..4ae70b3f35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-03-13  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+	* scm/backend-library.scm (output-scopes, header-to-file): Move
+	from framework-tex.scm.
+
+	* scm/framework-ps.scm (output-framework)
+	(output-preview-framework):
+	* scm/framework-eps.scm (output-classic-framework)
+	(output-framework): Use it.  Fixes collated files.
+
 2005-03-12  Jan Nieuwenhuizen  <janneke@gnu.org>
 
 	* input/sakura-sakura.ly: 
diff --git a/input/les-nereides.ly b/input/les-nereides.ly
index 1f1fbc5754..27e0b55460 100644
--- a/input/les-nereides.ly
+++ b/input/les-nereides.ly
@@ -296,6 +296,7 @@ theScore = \score{
 }
     
 %%% Local variables:
+%%% coding: utf-8
 %%% LilyPond-indent-level:4
 %%% End:
 
diff --git a/input/mutopia/E.Satie/petite-ouverture-a-danser.ly b/input/mutopia/E.Satie/petite-ouverture-a-danser.ly
index f2bef8b2b4..28fd54b8c7 100644
--- a/input/mutopia/E.Satie/petite-ouverture-a-danser.ly
+++ b/input/mutopia/E.Satie/petite-ouverture-a-danser.ly
@@ -1,13 +1,13 @@
 \header {
   title = "Petite Ouverture à danser"
-  subtitle =	"4"
+  subtitle = "4"
   source = ""
   composer = "Erik Satie (1866-1925)"
   enteredby = "jcn"
   copyright = "Public Domain"
 }
 
-\version "2.4.0"
+\version "2.5.13"
 
 \include "nederlands.ly"
 
@@ -163,4 +163,6 @@ lower = \context Staff  \relative c{
     }
 }
 
-
+%% Local Variables:
+%% coding: utf-8
+%% End:
diff --git a/input/mutopia/F.Schubert/morgenlied.ly b/input/mutopia/F.Schubert/morgenlied.ly
index ff3416f0f8..90442b062b 100644
--- a/input/mutopia/F.Schubert/morgenlied.ly
+++ b/input/mutopia/F.Schubert/morgenlied.ly
@@ -27,7 +27,7 @@ been lowered
 
 }
 
-\version "2.4.0"
+\version "2.5.13"
 manuscriptBreak = { \break }
 
 
diff --git a/input/mutopia/J.S.Bach/bwv940.ly b/input/mutopia/J.S.Bach/bwv940.ly
index 61a2b620f6..5eb7bce4ea 100644
--- a/input/mutopia/J.S.Bach/bwv940.ly
+++ b/input/mutopia/J.S.Bach/bwv940.ly
@@ -1,5 +1,5 @@
 #(ly:set-option 'old-relative)
-\version "2.4.0"
+\version "2.5.13"
 
 %{
  Header for Petites Preludes.
diff --git a/input/mutopia/J.S.Bach/wtk1-fugue2.ly b/input/mutopia/J.S.Bach/wtk1-fugue2.ly
index 990a0fda1d..e1e1c08682 100644
--- a/input/mutopia/J.S.Bach/wtk1-fugue2.ly
+++ b/input/mutopia/J.S.Bach/wtk1-fugue2.ly
@@ -44,7 +44,7 @@ to match up.
 %}
 
 
-\version "2.5.2"
+\version "2.5.13"
 
 
 
diff --git a/input/mutopia/R.Schumann/romanze-op28-2.ly b/input/mutopia/R.Schumann/romanze-op28-2.ly
index 5fd784b3d3..ff08b92809 100644
--- a/input/mutopia/R.Schumann/romanze-op28-2.ly
+++ b/input/mutopia/R.Schumann/romanze-op28-2.ly
@@ -5,7 +5,7 @@
 
 #(set-global-staff-size 16)
 
-\version "2.5.2"
+\version "2.5.13"
 
 \header {
   title = "Romanzen"
diff --git a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly
index 2ba9a4563c..9cc23eb420 100644
--- a/input/mutopia/W.A.Mozart/mozart-hrn-3.ly
+++ b/input/mutopia/W.A.Mozart/mozart-hrn-3.ly
@@ -1,8 +1,8 @@
 \header{
-  title =	 "Konzert Nr. 3 Es dur"
-  subtitle = "für Horn und Orchester"
-  composer =	 "Wolfgang Amadeus Mozart (1756-1791)"
-  enteredby =	 "HWN"
+  title = "Konzert Nr. 3 Es dur"
+  subtitle = "für Horn und Orchester"
+  composer = "Wolfgang Amadeus Mozart (1756-1791)"
+  enteredby = "HWN"
   opus = "KV 447"
 
   copyright = "public domain"
@@ -41,7 +41,7 @@ virtuoso that taught in Geneva.
 
 %}
 
-\version "2.5.2"
+\version "2.5.13"
 
 \include "mozart-hrn3-defs.ily"
 \include "mozart-hrn3-allegro.ily"
@@ -55,31 +55,29 @@ virtuoso that taught in Geneva.
 
 
 \book {
-    \score
-    {
+    \score {
 	{ \transpose c' bes \allegro }
-	\layout{ }
+	\layout { }
 	\header { piece = "allegro" opus = "" }	
-	\midi{ \tempo 4=90 }
+	\midi { \tempo 4=90 }
     }
 
-
-    \score
-    {
+    \score {
 	{ \transpose c' bes \romanze }
 	\header { piece = "romanze" opus = "" }	
-	\midi{ \tempo 4 = 70  }
-	\layout{}
+	\midi { \tempo 4 = 70  }
+	\layout {}
     }
 
-
     \score
     {
-	{ \transpose c' bes	\rondo }
+	{ \transpose c' bes \rondo }
 	\header { piece = "rondo" opus = "" }
-	\midi{ \tempo 4 = 100 }
+	\midi { \tempo 4 = 100 }
 	\layout { }
     }
-
-
 }
+
+%% Local Variables:
+%% coding: utf-8
+%% End:
diff --git a/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily b/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily
index fcf57342df..86b660df7c 100644
--- a/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily
+++ b/input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily
@@ -1,10 +1,10 @@
-% #(ly:set-point-and-click 'line-column)
+% 
 
 longgrace = \override Stem  #'stroke-style = #'()
 endlonggrace = \revert Stem #'stroke-style
 ritenuto = \markup { \italic  "rit." }
 
-\version "2.4.0"
+\version "2.5.13"
   
 cresc =  {
     #(ly:export (make-event-chord (list (make-span-event 'CrescendoEvent START)))) 
diff --git a/input/mutopia/W.A.Mozart/mozart-hrn3-romanze.ily b/input/mutopia/W.A.Mozart/mozart-hrn3-romanze.ily
index e26e273b93..a65f8ddebf 100644
--- a/input/mutopia/W.A.Mozart/mozart-hrn3-romanze.ily
+++ b/input/mutopia/W.A.Mozart/mozart-hrn3-romanze.ily
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.13"
 \include  "mozart-hrn3-defs.ily"
 
 romanze =  \relative c' {
diff --git a/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily b/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily
index 48270de339..ec36ca971a 100644
--- a/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily
+++ b/input/mutopia/W.A.Mozart/mozart-hrn3-rondo.ily
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.13"
 
 % \include "mozart-hrn3-defs.ily"
 
diff --git a/input/test/coriolan-margin.ly b/input/test/coriolan-margin.ly
index 1551301c2e..c447c9a25d 100644
--- a/input/test/coriolan-margin.ly
+++ b/input/test/coriolan-margin.ly
@@ -1,10 +1,10 @@
 
-\version "2.5.2"
+\version "2.5.13"
 
 
 % Ugh, we need to override some LaTeX titling stuff
 \header {
-  title =	"Ouvertüre"
+  title =	"Ouvertüre"
   subtitle =	"Zu Heinrich Joseph v. Collins Trauerspiel"
   subsubtitle =	\markup { \large \bold "Coriolan" }
   opus = "Op. 62"
@@ -154,3 +154,7 @@ violoncello =  \relative c' {
 	linewidth=150.0\mm
     }
 }
+
+%% Local Variables:
+%% coding: utf-8
+%% End:
diff --git a/input/test/dynamic-extra.ly b/input/test/dynamic-extra.ly
index 2992630ef7..b9a80203e0 100644
--- a/input/test/dynamic-extra.ly
+++ b/input/test/dynamic-extra.ly
@@ -1,9 +1,9 @@
 
-\version "2.4.0"
+\version "2.5.13"
 % probably should be merged into refman.
 \header{
     texidoc = "@cindex Dynamic Piu Forte
-Più forte dynamics is produced using @code{\markup}. " }
+Più forte dynamics is produced using @code{\markup}. " }
 
 piuf =	\markup {  \italic "pi\\`u" \dynamic "f" }
 
@@ -19,3 +19,6 @@ piuf =	\markup {  \italic "pi\\`u" \dynamic "f" }
     }
 
 
+%% Local Variables:
+%% coding: utf-8
+%% End:
diff --git a/input/test/title-markup.ly b/input/test/title-markup.ly
index bbfc6447df..ed47341580 100644
--- a/input/test/title-markup.ly
+++ b/input/test/title-markup.ly
@@ -1,4 +1,4 @@
-\version "2.5.2"
+\version "2.5.13"
 
 %{
    Markup titles also available for direct PostScript output:
@@ -33,7 +33,7 @@ For century schoolbook font:
 }
 
 latinTest = \markup {
-    "Hellö"
+    "Hellö"
 }
     
 sizeTest = \markup {
@@ -65,11 +65,11 @@ spaceTest = \markup { "two space chars" }
 
     tagline = "my tagline for "
     
-    %dedication = "För my dør Lily"
+    %dedication = "För my dør Lily"
     % ugh: encoding char-size
-    %dedication = "For my öòóôõø so dear Lily"
+    %dedication = "For my öòóôõø so dear Lily"
     dedication = \markup { "For my "
-%			   "öòóôõø"
+%			   "öòóôõø"
 			   " so dear Lily" }
     title = "Title"
     subtitle = "(and (the) subtitle)"
@@ -121,3 +121,7 @@ spaceTest = \markup { "two space chars" }
 	}
     }
 }
+
+%% Local Variables:
+%% coding: utf-8
+%% End:
diff --git a/scm/backend-library.scm b/scm/backend-library.scm
index cb4ac82b0d..d03b95870c 100644
--- a/scm/backend-library.scm
+++ b/scm/backend-library.scm
@@ -84,3 +84,31 @@
    '("tex" "dvi" "ps" "pdf" "png"))
 
   new-fmts)
+
+(define (header-to-file file-name key value)
+  (set! key (symbol->string key))
+  (if (not (equal? "-" file-name))
+      (set! file-name (string-append file-name "." key)))
+  (format (current-error-port)
+	  (_ "Writing header field `~a' to `~a'...")
+	  key
+	  (if (equal? "-" file-name) "<stdout>" file-name))
+  (if (equal? file-name "-")
+      (display value)
+      (display value (open-file file-name "w")))
+  (newline (current-error-port))
+  "")
+
+(define-public (output-scopes scopes fields basename)
+  (define (output-scope scope)
+    (apply
+     string-append
+     (module-map
+      (lambda (sym var)
+	(let ((val (if (variable-bound? var) (variable-ref var) "")))
+	  (if (and (memq sym fields) (string? val))
+	      (header-to-file basename sym val))
+	  ""))
+      scope)))
+  (apply string-append (map output-scope scopes)))
+
diff --git a/scm/framework-eps.scm b/scm/framework-eps.scm
index 1e9631ec16..fb853c9f7d 100644
--- a/scm/framework-eps.scm
+++ b/scm/framework-eps.scm
@@ -23,23 +23,19 @@
 (define (dump-stencils-as-EPSes stencils book basename)
   (define paper (ly:paper-book-paper book))
   (define (dump-infinite-stack-EPS stencils)
-    (let*
-	((dump-me (stack-stencils Y DOWN 2.0 stencils)))
-      (dump-stencil-as-EPS paper dump-me basename #t)
-      ))
+    (let* ((dump-me (stack-stencils Y DOWN 2.0 stencils)))
+      (dump-stencil-as-EPS paper dump-me basename #t)))
 
   (define (dump-stencils-as-separate-EPS stencils count)
     (if (pair? stencils)
-	(let*
-	    ((line (car stencils))
-	     (rest (cdr stencils)))
+	(let* ((line (car stencils))
+	       (rest (cdr stencils)))
 	  (dump-stencil-as-EPS
 	   paper
 	   line (format "~a-~a" basename count)
 	   (ly:output-def-lookup paper 'force-eps-font-include))
-
-	  (dump-stencils-as-separate-EPS rest (1+ count))
-	  )))
+	  
+	  (dump-stencils-as-separate-EPS rest (1+ count)))))
   
   (let* ((tex-system-name (format "~a-systems.tex" basename))
 	 (texi-system-name (format "~a-systems.texi" basename))
@@ -63,18 +59,16 @@
     (postprocess-output book framework-eps-module
 			(format "~a.eps" basename) (ly:output-formats)))
 
-(define-public (output-classic-framework
-		basename book scopes fields)
-
+(define-public (output-classic-framework basename book scopes fields)
+  (output-scopes scopes fields basename)
   (dump-stencils-as-EPSes
    (map ly:paper-system-stencil (ly:paper-book-systems book))
    book
    basename))
 
 (define-public (output-framework basename book scopes fields)
-  (dump-stencils-as-EPSes (ly:paper-book-pages book)
-			  book
-			  basename))
+  (output-scopes scopes fields basename)
+  (dump-stencils-as-EPSes (ly:paper-book-pages book) book basename))
   
 
 ; redefine to imports from framework-ps
diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm
index 1176c6d66f..e27cf4115a 100644
--- a/scm/framework-ps.scm
+++ b/scm/framework-ps.scm
@@ -269,7 +269,7 @@
 	 (page-count (length pages))
 	 (port (ly:outputter-port outputter)))
 
-
+    (output-scopes scopes fields basename)
     (display (page-header paper page-count #t) port)
     (write-preamble paper #t  port)
 
@@ -331,10 +331,10 @@
     ))
 
 
-(define-public (output-preview-framework basename book scopes fields )
+(define-public (output-preview-framework basename book scopes fields)
   (let* ((paper (ly:paper-book-paper book))
 	 (systems (ly:paper-book-systems book))
-	 (scale  (ly:output-def-lookup paper 'outputscale))
+	 (scale (ly:output-def-lookup paper 'outputscale))
 	 (titles (take-while ly:paper-system-title? systems))
 	 (non-title (find (lambda (x)
 			    (not (ly:paper-system-title? x))) systems))
@@ -342,6 +342,7 @@
 	  (stack-stencils Y DOWN 0.0
 			  (map ly:paper-system-stencil
 			       (append titles (list non-title))))))
+    (output-scopes scopes fields basename)
     (dump-stencil-as-EPS paper dump-me
 			 (format "~a.preview" basename)
 			 #t)))
diff --git a/scm/framework-tex.scm b/scm/framework-tex.scm
index 54f6539e4f..fa6ba28bb5 100644
--- a/scm/framework-tex.scm
+++ b/scm/framework-tex.scm
@@ -122,34 +122,6 @@
 	  (map (lambda (x) (font-load-command paper x))
 	       (ly:paper-fonts paper)))))
 
-(define (header-to-file fn key val)
-  (set! key (symbol->string key))
-  (if (not (equal? "-" fn))
-      (set! fn (string-append fn "." key)))
-  (display
-   (format (_ "Writing header field `~a' to `~a'...")
-	   key
-	   (if (equal? "-" fn) "<stdout>" fn))
-   (current-error-port))
-  (if (equal? fn "-")
-      (display val)
-      (display val (open-file fn "w")))
-  (newline (current-error-port))
-  "")
-
-(define (output-scopes scopes fields basename)
-  (define (output-scope scope)
-    (apply
-     string-append
-     (module-map
-      (lambda (sym var)
-	(let ((val (if (variable-bound? var) (variable-ref var) "")))
-	  (if (and (memq sym fields) (string? val))
-	      (header-to-file basename sym val))
-	  ""))
-      scope)))
-  (apply string-append (map output-scope scopes)))
-
 (define (tex-string-def prefix key str)
   (if (equal? "" (sans-surrounding-whitespace (sanitize-tex-string str)))
       (string-append "\\let\\" prefix (symbol->tex-key key) "\\undefined%\n")
-- 
2.39.5