]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 5105/3: Allow number as MarkEvent.label
authorDavid Kastrup <dak@gnu.org>
Thu, 23 Mar 2017 23:20:58 +0000 (00:20 +0100)
committerDavid Kastrup <dak@gnu.org>
Fri, 31 Mar 2017 09:34:37 +0000 (11:34 +0200)
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.

ly/music-functions-init.ly
scm/define-music-properties.scm

index 4bd7d03fa69fd03fdfa45fe7cb5295470878bc0f..783bed0288437e514e80486317c0f78a2e813744 100644 (file)
@@ -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)
index f8c567d1fa09d50958744e22e18166b8c1ec67d5..211af8afb366b1f5cde58fec3c349a0169dc85f1 100644 (file)
@@ -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.