Reviewers: janek,

Message:
On 2014/10/19 16:58:04, dak wrote:
https://codereview.appspot.com/156400043/diff/1/ly/property-init.ly
File ly/property-init.ly (right):


https://codereview.appspot.com/156400043/diff/1/ly/property-init.ly#newcode359
ly/property-init.ly:359: lineBreaksOn =
It might be more consistent with other overrides in this file to make
the
commands for (re-)establishing the default settings, namely
\lineBreaksOn and
\pageBreaksOn, be reverts rather than overrides.

done

Description:
Issue 4169: Line and page breaking syntactic sugar

  Install line- and page-breaking controls and document them.

  Amend indexing.

Please review this at https://codereview.appspot.com/156400043/

Affected files (+47, -9 lines):
  M Documentation/notation/spacing.itely
  M ly/property-init.ly


Index: Documentation/notation/spacing.itely
diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index 1cded7566af4e6d379f2c0ba73656300e7029b97..94f14d6ef83763276fbf1509d59cfc8453a5a651 100644
--- a/Documentation/notation/spacing.itely
+++ b/Documentation/notation/spacing.itely
@@ -1372,7 +1372,13 @@ staff lines.
 @node Line breaking
 @subsection Line breaking

-@cindex line breaks
+@funindex \break
+@funindex \noBreak
+@funindex \breaksOff
+@funindex \breaksOn
+@funindex \lineBreaksOff
+@funindex \lineBreaksOn
+@cindex manual line breaks
 @cindex breaking lines

 Line breaks are normally determined automatically.  They are
@@ -1430,6 +1436,13 @@ c8 c] c2. |
 The @code{\noBreak} command forbids a line break at the bar line
 where it is inserted.

+Within a score, line breaks are prevented within music lying between
+@code{\lineBreaksOff} and @code{\lineBreaksOn} commands.  If page
+breaks should also be prevented, the commands @code{\breaksOff} and
+@code{\breaksOn} should be used.  Note that inhibiting line breaks
+will cause music to run over the right margin if it cannot all be
+contained within one line.
+
 The most basic settings influencing line spacing are @code{indent}
 and @code{line-width}.  They are set in the @code{\layout} block.
 They control the indentation of the first line of music, and the
@@ -1474,10 +1487,12 @@ broken every 4 measures, and only there:


 @predefined
-@funindex \break
 @code{\break},
-@funindex \noBreak
-@code{\noBreak}.
+@code{\noBreak},
+@code{\breaksOff},
+@code{\breaksOn},
+@code{\lineBreaksOff},
+@code{\lineBreaksOn}.
 @endpredefined

 @seealso
@@ -1510,16 +1525,25 @@ how to modify them.
 @node Manual page breaking
 @unnumberedsubsubsec Manual page breaking

+@funindex \pageBreak
+@funindex \noPageBreak
+@funindex \pageBreaksOn
+@funindex \pageBreaksOff
+@cindex page breaking, manual
+
 The default page breaking may be overridden by inserting
 @code{\pageBreak} or @code{\noPageBreak} commands.  These commands
 are analogous to @code{\break} and @code{\noBreak}.  They should
 be inserted at a bar line.  These commands force and forbid a
-page-break from happening.  Of course, the @code{\pageBreak}
-command also forces a line break.
+page-break from happening at that bar line.  Of course, the
+@code{\pageBreak} command also forces a line break.

 The @code{\pageBreak} and @code{\noPageBreak} commands may also be
 inserted at top-level, between scores and top-level markups.

+Within a score, page breaks are prevented within music lying between
+@code{\pageBreaksOff} and @code{\pageBreaksOn} commands.
+
 There are also analogous settings to @code{ragged-right} and
 @code{ragged-last} which have the same effect on vertical spacing.
 If @code{ragged-bottom} is set to @code{#t} the systems will not
@@ -1577,10 +1601,10 @@ functions may also be used in different book parts.


 @predefined
-@funindex \pageBreak
 @code{\pageBreak},
-@funindex \noPageBreak
-@code{\noPageBreak}.
+@code{\noPageBreak},
+@code{\pageBreaksOn},
+@code{\pageBreaksOff}.
 @endpredefined

 @seealso
Index: ly/property-init.ly
diff --git a/ly/property-init.ly b/ly/property-init.ly
index 8d6d892d17d3d790139c636302266321ebfb7361..06da3bc49990349f3f00d5f8b981644ad264a281 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -352,6 +352,20 @@ kievanOff = {
  \revert NoteHead.duration-log
 }

+%% line and page breaking controls
+
+lineBreaksOff =
+  \override Score.NonMusicalPaperColumn.line-break-permission = ##f
+lineBreaksOn =
+  \override Score.NonMusicalPaperColumn.line-break-permission = #'allow
+pageBreaksOff =
+  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
+pageBreaksOn =
+  \override Score.NonMusicalPaperColumn.page-break-permission = #'allow
+breaksOff = { \lineBreaksOff \pageBreaksOff }
+breaksOn = { \lineBreaksOn \pageBreaksOn }
+
+
 %% merging

 mergeDifferentlyDottedOn =



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to