From 3c8c7f97c35c3d424bb004d7c0fbd16af94d44cc Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Tue, 17 Aug 2010 15:39:10 +0100 Subject: [PATCH] Add point-and-click to non-default rehearsal marks. * lily/parser.yy (command_element): call make-mark-set via MAKE_SYNTAX so input location can be used * scm/ly-syntax-constructors.scm (make-mark-set): set 'origin for MarkEvent * scm/music-functions.scm (make-mark-set): move to ly-syntax-constructors.scm --- lily/parser.yy | 4 +--- scm/ly-syntax-constructors.scm | 15 +++++++++++++++ scm/music-functions.scm | 22 ++++------------------ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lily/parser.yy b/lily/parser.yy index a9d8938889..7fff408f7d 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1642,9 +1642,7 @@ command_element: $$ = scm_apply_2 (proc, scm_car ($2), scm_cdr ($2), SCM_EOL); } | MARK scalar { - SCM proc = ly_lily_module_constant ("make-mark-set"); - - $$ = scm_call_1 (proc, $2); + $$ = MAKE_SYNTAX ("make-mark-set", @$, $2); } ; diff --git a/scm/ly-syntax-constructors.scm b/scm/ly-syntax-constructors.scm index 565dfbb6a7..98365930fe 100644 --- a/scm/ly-syntax-constructors.scm +++ b/scm/ly-syntax-constructors.scm @@ -232,3 +232,18 @@ into a @code{MultiMeasureTextEvent}." 'origin loc))) addlyrics-list))) (make-simultaneous-music (cons voice lyricstos)))) + +(define-ly-syntax (make-mark-set parser location label) + "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)) + (ch (make-event-chord (list ev)))) + + (set! (ly:music-property ev 'origin) location) + (if set + (make-sequential-music (list set ch)) + (begin + (set! (ly:music-property ev 'label) label) + ch)))) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 1dfa6bc0ac..a9f54cd443 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -505,24 +505,10 @@ i.e. this is not an override" If @var{rest} is present, it is used to set @code{beatStructure}." (ly:export - (make-music 'TimeSignatureMusic - 'numerator num - 'denominator den - 'beat-structure (if (null? rest) rest (car rest))))) - -(define-public (make-mark-set label) - "Make the music for the \\mark command." - (let* ((set (if (integer? label) - (context-spec-music (make-property-set 'rehearsalMark label) - 'Score) - #f)) - (ev (make-music 'MarkEvent)) - (ch (make-event-chord (list ev)))) - (if set - (make-sequential-music (list set ch)) - (begin - (set! (ly:music-property ev 'label) label) - ch)))) + (make-music 'TimeSignatureMusic + 'numerator num + 'denominator den + 'beat-structure (if (null? rest) rest (car rest))))) (define-safe-public (make-articulation name) (make-music 'ArticulationEvent -- 2.39.2