From: David Kastrup Date: Thu, 23 Mar 2017 23:20:58 +0000 (+0100) Subject: Issue 5105/3: Allow number as MarkEvent.label X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=0155c0a0c4196add9ce65341910bc451f975d183;p=lilypond.git Issue 5105/3: Allow number as MarkEvent.label This puts all Mark counter handling in the hand of the Mark_engraver . Interestingly, Mark_engraver itself already was perfectly equipped to dealing with that, but the `label' property did not yet accept numbers. --- diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 4bd7d03fa6..783bed0288 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -830,20 +830,11 @@ transpose from @var{around} to @var{to}.") (music-invert around to music)) mark = -#(define-music-function - (label) ((number-or-markup?)) - "Make the music for the \\mark command." - (let* ((set (and (integer? label) - (context-spec-music (make-property-set 'rehearsalMark label) - 'Score))) - (ev (make-music 'MarkEvent - 'origin (*location*)))) - - (if set - (make-sequential-music (list set ev)) - (begin - (if label (set! (ly:music-property ev 'label) label)) - ev)))) +#(define-music-function (label) ((number-or-markup?)) + "Make the music for the \\mark command." + (if label + (make-music 'MarkEvent 'label label) + (make-music 'MarkEvent))) markupMap = #(define-music-function (path markupfun music) diff --git a/scm/define-music-properties.scm b/scm/define-music-properties.scm index f8c567d1fa..211af8afb3 100644 --- a/scm/define-music-properties.scm +++ b/scm/define-music-properties.scm @@ -108,7 +108,7 @@ property, e.g., @code{(beamed-lengths details)}.") (iterator-ctor ,procedure? "Function to construct a @code{music-event-iterator} object for this music.") - (label ,markup? "Label of a mark.") + (label ,number-or-markup? "Label of a mark.") (last-pitch ,ly:pitch? "The last pitch after relativization.") (length ,ly:moment? "The duration of this music.") (length-callback ,procedure? "How to compute the duration of this music.