From: David Kastrup Date: Fri, 8 Nov 2013 14:54:56 +0000 (+0100) Subject: Revert "Issue 1334: A \score-lines markup list command for multi-lines embedded scores" X-Git-Tag: release/2.17.96-1~22 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=cd9acecf07523322f6d209778695346ce2f369f9;p=lilypond.git Revert "Issue 1334: A \score-lines markup list command for multi-lines embedded scores" This reverts commit c2f316e714d49e8d9557a7148f92b53ff96db21b. Conflicts: scm/define-markup-commands.scm --- diff --git a/lily/parser.yy b/lily/parser.yy index ab09f537b2..4ed5733324 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -3355,7 +3355,7 @@ full_markup: ; markup_top: - simple_markup_list { + markup_list { $$ = scm_list_2 (ly_lily_module_constant ("line-markup"), $1); } | markup_head_1_list simple_markup @@ -3383,7 +3383,7 @@ markup_scm: ; -simple_markup_list: +markup_list: markup_composed_list { $$ = $1; } @@ -3403,24 +3403,6 @@ markup_uncomposed_list: } ; -markup_list: - simple_markup_list - | markup_score - { - $$ = scm_list_1 (scm_list_2 (ly_lily_module_constant ("score-lines-markup-list"), $1)); - } - ; - -markup_score: - SCORE { - SCM nn = parser->lexer_->lookup_identifier ("pitchnames"); - parser->lexer_->push_note_state (nn); - } '{' score_body '}' { - $$ = $4; - parser->lexer_->pop_state (); - } - ; - markup_composed_list: markup_head_1_list markup_uncomposed_list { $$ = MAKE_SYNTAX ("composed-markup-list", @@ -3439,7 +3421,7 @@ markup_braced_list_body: | markup_braced_list_body markup { $$ = scm_cons ($2, $1); } - | markup_braced_list_body simple_markup_list { + | markup_braced_list_body markup_list { $$ = scm_reverse_x ($2, $1); } ; @@ -3488,6 +3470,13 @@ simple_markup: STRING { $$ = make_simple_markup ($1); } + | SCORE { + SCM nn = parser->lexer_->lookup_identifier ("pitchnames"); + parser->lexer_->push_note_state (nn); + } '{' score_body '}' { + $$ = scm_list_2 (ly_lily_module_constant ("score-markup"), $4); + parser->lexer_->pop_state (); + } | MARKUP_FUNCTION markup_command_basic_arguments { $$ = scm_cons ($1, scm_reverse_x ($2, SCM_EOL)); } @@ -3495,10 +3484,6 @@ simple_markup: { $$ = $2; } - | markup_score - { - $$ = scm_list_2 (ly_lily_module_constant ("score-markup"), $1); - } ; markup: diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 9e5528f5bb..1ea06e5f1d 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -1012,31 +1012,6 @@ samplePath = X-extent Y-extent))) -(define-markup-list-command (score-lines layout props score) - (ly:score?) - " -This is the same as the @code{\\score} markup but delivers its -systems as a list of lines. This is not usually called directly by -the user. Instead, it is called when the parser encounters -@code{\\score} in a context where only markup lists are allowed. When -used as the argument of a toplevel @code{\\markuplist}, the result can -be split across pages." - (let ((output (ly:score-embedded-format score layout))) - - (if (ly:music-output? output) - (map - (lambda (paper-system) - ;; shift such that the refpoint of the bottom staff of - ;; the first system is the baseline of the score - (ly:stencil-translate-axis - (paper-system-stencil paper-system) - (- (car (paper-system-staff-extents paper-system))) - Y)) - (vector->list (ly:paper-score-paper-systems output))) - (begin - (ly:warning (_"no systems found in \\score markup, does it have a \\layout block?")) - '())))) - (define-markup-command (score layout props score) (ly:score?) #:category music @@ -1089,8 +1064,24 @@ baseline. } } @end lilypond" - (stack-stencils Y DOWN baseline-skip - (score-lines-markup-list layout props score))) + (let ((output (ly:score-embedded-format score layout))) + + (if (ly:music-output? output) + (let ((paper-systems + (vector->list + (ly:paper-score-paper-systems output)))) + (if (pair? paper-systems) + ;; shift such that the refpoint of the bottom staff of + ;; the first system is the baseline of the score + (ly:stencil-translate-axis + (stack-stencils Y DOWN baseline-skip + (map paper-system-stencil paper-systems)) + (- (car (paper-system-staff-extents (car paper-systems)))) + Y) + empty-stencil)) + (begin + (ly:warning (_"no systems found in \\score markup, does it have a \\layout block?")) + empty-stencil)))) (define-markup-command (null layout props) ()