From: hanwen Date: Tue, 21 Sep 2004 17:32:46 +0000 (+0000) Subject: (score_body): disallow \bookpaper in \score. X-Git-Tag: release/2.3.24^2~162 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8a81ceb6777951992b4ceb2b050ebea57eadad7c;p=lilypond.git (score_body): disallow \bookpaper in \score. --- diff --git a/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly b/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly index 85cba5fa8a..b1322e7bfe 100644 --- a/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly +++ b/input/mutopia/J.S.Bach/baerenreiter-sarabande.ly @@ -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= "" diff --git a/lily/global-context.cc b/lily/global-context.cc index b00124606d..1621336bc6 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -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")); } diff --git a/lily/parser.yy b/lily/parser.yy index 9875722b79..3353ecf71a 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -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 {