From 84c9074729c7a0b36d27be81794ca25a8829f9f3 Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Mon, 11 Jul 2005 12:59:30 +0000
Subject: [PATCH] *** empty log message ***

---
 lily/book-scheme.cc         |  2 +-
 lily/include/lily-parser.hh |  3 ---
 lily/lily-parser.cc         |  4 ----
 lily/score-scheme.cc        |  7 +++----
 ly/init.ly                  |  1 +
 scm/lily-library.scm        | 12 ++++++------
 scm/ly-from-scheme.scm      |  2 +-
 7 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/lily/book-scheme.cc b/lily/book-scheme.cc
index c3b30bd8e7..f430377fce 100644
--- a/lily/book-scheme.cc
+++ b/lily/book-scheme.cc
@@ -36,7 +36,7 @@ LY_DEFINE (ly_make_book, "ly:make-book",
 }
 
 LY_DEFINE (ly_parser_print_book, "ly:book-process",
-	   3, 0, 0, (SCM book_smob,
+	   4, 0, 0, (SCM book_smob,
 		     SCM default_paper,
 		     SCM default_layout,
 		     SCM basename),
diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh
index f71e0c3ed5..9a2fd02f63 100644
--- a/lily/include/lily-parser.hh
+++ b/lily/include/lily-parser.hh
@@ -41,9 +41,6 @@ public:
   Duration default_duration_;
   String output_basename_;
 
-  int score_count_;
-  int book_count_;
-
   int fatal_error_;
   int error_level_;
   bool ignore_version_b_;
diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc
index 28f8b5146c..2c39ea6da3 100644
--- a/lily/lily-parser.cc
+++ b/lily/lily-parser.cc
@@ -25,8 +25,6 @@
 
 Lily_parser::Lily_parser (Sources *sources)
 {
-  book_count_ = 0;
-  score_count_ = 0;
   lexer_ = 0;
   sources_ = sources;
   default_duration_ = Duration (2, 0);
@@ -40,8 +38,6 @@ Lily_parser::Lily_parser (Sources *sources)
 
 Lily_parser::Lily_parser (Lily_parser const &src)
 {
-  book_count_ = src.book_count_;
-  score_count_ = src.score_count_;
   lexer_ = 0;
   sources_ = src.sources_;
   default_duration_ = src.default_duration_;
diff --git a/lily/score-scheme.cc b/lily/score-scheme.cc
index ddd97e3a0d..9690a6cfea 100644
--- a/lily/score-scheme.cc
+++ b/lily/score-scheme.cc
@@ -74,20 +74,19 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
 }
 
 LY_DEFINE (ly_score_process, "ly:score-process",
-	   2, 0, 0,
+	   5, 0, 0,
 	   (SCM score_smob,
 	    SCM default_header,
 	    SCM default_paper,
 	    SCM default_layout,
 	    SCM basename),
-	   "Print score, i.e., the classic way.")
+	   "Print score without page-layout: just print the systems.")
 {
   Score *score = unsmob_score (score_smob);
 
   SCM_ASSERT_TYPE (score, score_smob, SCM_ARG1, __FUNCTION__, "score");
 
-  SCM_ASSERT_TYPE (ly_is_module (default_header),
-		   default_header, SCM_ARG2, __FUNCTION__, "module");
+  // allow header to be undefined.
   SCM_ASSERT_TYPE (unsmob_output_def (default_paper),
 		   default_header, SCM_ARG3, __FUNCTION__, "\\paper block");
   SCM_ASSERT_TYPE (unsmob_output_def (default_layout),
diff --git a/ly/init.ly b/ly/init.ly
index 29694bb3d8..c17531f6b6 100644
--- a/ly/init.ly
+++ b/ly/init.ly
@@ -14,6 +14,7 @@
 
 #(ly:set-option 'old-relative #f)
 #(define toplevel-scores '())
+#(define output-count 0) 
 #(define $globalheader #f)
 #(define version-seen? #f)
 
diff --git a/scm/lily-library.scm b/scm/lily-library.scm
index f14f3d7b42..8ea362a198 100644
--- a/scm/lily-library.scm
+++ b/scm/lily-library.scm
@@ -61,7 +61,7 @@
     (ly:parser-print-score parser book)))
 		
 (define-public (collect-scores-for-book parser score)
-  (ly:parser-define
+  (ly:parser-define!
    parser 'toplevel-scores
    (cons score (ly:parser-lookup parser 'toplevel-scores))))
 
@@ -82,7 +82,7 @@
   (let*
       ((paper (ly:parser-lookup parser '$defaultpaper))
        (layout (ly:parser-lookup parser '$defaultlayout))
-       (count (ly:parser-lookup parser 'book-count))
+       (count (ly:parser-lookup parser 'output-count))
        (base (ly:parser-output-name parser)))
 
     (if (not (integer? count))
@@ -91,7 +91,7 @@
     (if (> count 0)
 	(set! (base (format #f "~a-~a" count))))
 
-    (ly:parser-define! book-count (1+ count))
+    (ly:parser-define! parser 'output-count (1+ count))
     
 
     (ly:book-process book paper layout base)
@@ -101,8 +101,8 @@
   (let*
       ((paper (ly:parser-lookup parser '$defaultpaper))
        (layout (ly:parser-lookup parser '$defaultlayout))
-       (layout (ly:parser-lookup parser '$globalheader))
-       (count (ly:parser-lookup parser 'book-count))i
+       (header (ly:parser-lookup parser '$globalheader))
+       (count (ly:parser-lookup parser 'output-count))
        (base (ly:parser-output-name parser)))
 
     (if (not (integer? count))
@@ -111,7 +111,7 @@
     (if (> count 0)
 	(set! (base (format #f "~a-~a" count))))
 
-    (ly:parser-define! book-count (1+ count))
+    (ly:parser-define! parser 'output-count (1+ count))
     
 
     (ly:score-process score header paper layout base)
diff --git a/scm/ly-from-scheme.scm b/scm/ly-from-scheme.scm
index 00aab05b28..79267499bd 100644
--- a/scm/ly-from-scheme.scm
+++ b/scm/ly-from-scheme.scm
@@ -83,7 +83,7 @@ character."
 	  (result
 	   `(let ((parser-clone (ly:clone-parser parser)))
 	      ,@(map (lambda (binding)
-		       `(ly:parser-define parser-clone ',(car binding) ,(cdr binding)))
+		       `(ly:parser-define! parser-clone ',(car binding) ,(cdr binding)))
 		     (reverse bindings))
 	      (ly:parse-string-result ,lily-string parser-clone))
 	  ))
-- 
2.39.5