From: John Mandereau Date: Wed, 30 Apr 2008 19:23:23 +0000 (+0200) Subject: lilypond-book: make [relative] imply [fragment] X-Git-Tag: release/2.11.46-1~28^2~13^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7c885513913c438fc11929321cf42444367f2a32;p=lilypond.git lilypond-book: make [relative] imply [fragment] --- diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index cfbae202ec..4478c0d6cb 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -618,6 +618,10 @@ Set the amount by which the @code{quote} option indents a music snippet. Use relative octave mode. By default, notes are specified relative to middle@tie{}C. The optional integer argument specifies the octave of the starting note, where the default @code{1} is middle C. +@code{relative} option only works when @code{fragment} option is set, +so @code{fragment} is automatically implied by @code{relative}, +regardless of the presence of any @code{(no)fragment} option in the +source. @end table LilyPond also uses @command{lilypond-book} to produce its own diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index a57333e233..f10e07c172 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -991,6 +991,12 @@ class LilypondSnippet (Snippet): if k not in self.option_dict: self.option_dict[k] = default_ly_options[k] + # RELATIVE does not work without FRAGMENT; + # make RELATIVE imply FRAGMENT + has_relative = self.option_dict.has_key (RELATIVE) + if has_relative and not self.option_dict.has_key (FRAGMENT): + self.option_dict[FRAGMENT] = None + if not has_line_width: if type == 'lilypond' or FRAGMENT in self.option_dict: self.option_dict[RAGGED_RIGHT] = None