From 036e4e28cb84b4199127e8ce4e2f2f551a420ae4 Mon Sep 17 00:00:00 2001 From: Trevor Daniels Date: Fri, 17 Aug 2012 23:47:52 +0100 Subject: [PATCH] Rename paper variables: blank-*-force -> blank-*-penalty (2735) - update code and documentation - add convert-ly rule --- Documentation/notation/spacing.itely | 18 +++++++++--------- lily/page-breaking.cc | 6 +++--- ly/paper-defaults-init.ly | 6 +++--- python/convertrules.py | 7 +++++++ 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index 97c7b9813a..920a398f0b 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -908,31 +908,31 @@ will be the associated action relative to other choices. @table @code -@item blank-page-force -@funindex blank-page-force +@item blank-page-penalty +@funindex blank-page-penalty The penalty for having a blank page in the middle of a score. If -@code{blank-page-force} is large and @code{ly:page-turn-breaking} is +@code{blank-page-penalty} is large and @code{ly:page-turn-breaking} is selected, then LilyPond will be less likely to insert a page in the middle of a score. Instead, it will space out the music further to fill the blank page and the following one. Default: 5. -@item blank-last-page-force -@funindex blank-last-page-force +@item blank-last-page-penalty +@funindex blank-last-page-penalty The penalty for ending the score on an even-numbered page. If -@code{blank-last-page-force} is large and +@code{blank-last-page-penalty} is large and @code{ly:page-turn-breaking} is selected, then LilyPond will be less likely to produce a score in which the last page is even-numbered. Instead, it will adjust the spacing in order to use one page more or one page less. Default: 0. -@item blank-after-score-page-force -@funindex blank-after-score-page-force +@item blank-after-score-page-penalty +@funindex blank-after-score-page-penalty The penalty for having a blank page after the end of one score and before the next. By default, this is smaller than -@code{blank-page-force}, so that blank pages after scores are +@code{blank-page-penalty}, so that blank pages after scores are inserted in preference to blank pages within a score. Default: 2. @end table diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 692244b897..18582a607d 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -1224,11 +1224,11 @@ Page_breaking::blank_page_penalty () const SCM penalty_sym; if (is_last ()) - penalty_sym = ly_symbol2scm ("blank-last-page-force"); + penalty_sym = ly_symbol2scm ("blank-last-page-penalty"); else if (ends_score ()) - penalty_sym = ly_symbol2scm ("blank-after-score-page-force"); + penalty_sym = ly_symbol2scm ("blank-after-score-page-penalty"); else - penalty_sym = ly_symbol2scm ("blank-page-force"); + penalty_sym = ly_symbol2scm ("blank-page-penalty"); Break_position const &pos = breaks_[current_end_breakpoint_]; if (Paper_score *ps = system_specs_[pos.system_spec_index_].pscore_) diff --git a/ly/paper-defaults-init.ly b/ly/paper-defaults-init.ly index 79566954fc..4bde252d17 100644 --- a/ly/paper-defaults-init.ly +++ b/ly/paper-defaults-init.ly @@ -97,9 +97,9 @@ %% %% Page breaking %% - blank-after-score-page-force = 2 - blank-last-page-force = 0 - blank-page-force = 5 + blank-after-score-page-penalty = 2 + blank-last-page-penalty = 0 + blank-page-penalty = 5 page-breaking = #ly:optimal-breaking diff --git a/python/convertrules.py b/python/convertrules.py index 44ecf049e7..b3aa1676c0 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3380,6 +3380,13 @@ def conv (str): str = re.sub ('\n"(' + wordsyntax + r')"(\s*=\s*\\stringTuning)', "\n\\1\\2", str) return str +@rule ((2, 17, 0), r"blank-*-force -> blank-*-penalty") +def conv (str): + str = re.sub ('blank-page-force', 'blank-page-penalty', str) + str = re.sub ('blank-last-page-force', 'blank-last-page-penalty', str) + str = re.sub ('blank-after-score-page-force', 'blank-after-score-page-penalty', str) + return str + # Guidelines to write rules (please keep this at the end of this file) # # - keep at most one rule per version; if several conversions should be done, -- 2.39.5