]> git.donarmstrong.com Git - lilypond.git/commitdiff
(score_body): disallow \bookpaper in \score.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 21 Sep 2004 17:32:46 +0000 (17:32 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 21 Sep 2004 17:32:46 +0000 (17:32 +0000)
input/mutopia/J.S.Bach/baerenreiter-sarabande.ly
lily/global-context.cc
lily/parser.yy

index 85cba5fa8aa5d38dcea43c7af91688b3df011734..b1322e7bfe932ce8843f02b7f604f8ec156dc6ca 100644 (file)
@@ -163,27 +163,16 @@ smallerPaper = \paper {
     linewidth = 146.8 \mm
 }
 
-baerPaper = \paper {
-    indent = 7. \mm
-    linewidth =183.5 \mm
-%    interscoreline=4.0\mm
-    \context {
-            \Score
-%           \override System #'print-function = #box-grob-stencil
-    }
-}
-
 \bookpaper {
   raggedbottom = ##t
+  indent = 7. \mm
+  linewidth =183.5 \mm
   betweensystemspace = 25\mm 
   betweensystempadding = 0\mm
 }
 
 \score{
   \sarabandeCelloStaff
-  \paper{
-    \baerPaper
-  }
   \midi{ \tempo 4 = 40 }
   \header{
     opus= "" 
index b00124606d562ff94a46d01be23b259b0cbf4131..1621336bc625bf5f24017f506cb99424e227e1f6 100644 (file)
@@ -23,7 +23,14 @@ Global_context::Global_context (Output_def *o, Moment final)
   output_def_ = o;
   final_mom_ = final;
   definition_ = find_context_def (o, ly_symbol2scm ("Global"));
-  unsmob_context_def (definition_)->apply_default_property_operations (this);
+
+  Context_def *globaldef  =  unsmob_context_def (definition_);
+  if (!globaldef)
+    {
+      programming_error ("No `Global' context found.");
+    }
+  else
+    globaldef->apply_default_property_operations (this);
   accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
 }
 
index 9875722b79403293c2dca07730bb058b45283c63..3353ecf71ac48528bee8fe3e5fcc470cb1a1066e 100644 (file)
@@ -693,7 +693,15 @@ score_body:
                $$->header_ = $2;
        }
        | score_body output_def {
-               $$->defs_.push ($2);
+               if ($2->lookup_variable (ly_symbol2scm ("is-bookpaper")) =  SCM_BOOL_T)
+               {
+                       THIS->parser_error (_("\\bookpaper cannot be in \\score. Use \\paper instead"));
+               
+               }
+               else
+               {
+                       $$->defs_.push ($2);
+               }
                scm_gc_unprotect_object ($2->self_scm ());
        }
        | score_body error {