From 7c885513913c438fc11929321cf42444367f2a32 Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Wed, 30 Apr 2008 21:23:23 +0200 Subject: [PATCH] lilypond-book: make [relative] imply [fragment] --- Documentation/user/lilypond-book.itely | 4 ++++ scripts/lilypond-book.py | 6 ++++++ 2 files changed, 10 insertions(+) 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 -- 2.39.2