From: David Kastrup Date: Tue, 6 Dec 2011 00:05:18 +0000 (+0100) Subject: Remove spurious spaces from music expression display, adapt tests. X-Git-Tag: release/2.15.22-1~36^2~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=36bb5b7742c569408e4565fe0c3c01756b6486b1;p=lilypond.git Remove spurious spaces from music expression display, adapt tests. --- diff --git a/input/regression/display-lily-tests.ly b/input/regression/display-lily-tests.ly index 226d08d5e6..998627b716 100644 --- a/input/regression/display-lily-tests.ly +++ b/input/regression/display-lily-tests.ly @@ -92,8 +92,8 @@ stderr of this run." %% Lyrics \test ##[ \lyrics { a b } #] -\test ##[ \lyricmode { a -- b } #] % HyphenEvent -\test ##[ \lyricmode { a __ b } #] % ExtenderEvent +\test ##[ \lyricmode { a -- b } #] % HyphenEvent +\test ##[ \lyricmode { a __ b } #] % ExtenderEvent \test ##[ \lyricmode { "a " } #] % LyricEvent \test ##[ \lyricsto "foo" { bla bla } #] % LyricCombineMusic \test ##[ { { c d } @@ -107,41 +107,41 @@ stderr of this run." \test ##[ c4 ~ #] % TieEvent \test ##[ c\noBeam #] % BeamForbidEvent \test ##[ c\1 #] % StringNumberEvent -\test ##[ { c: c:1 } #] % TremoloEvent -\test ##[ { c-^ c^^ c_^ } #] % ArticulationEvent -\test ##[ { c-+ c^+ c_+ } #] -\test ##[ { c-- c^- c_- } #] -\test ##[ { c-| c^| c_| } #] -\test ##[ { c-> c^> c_> } #] -\test ##[ { c-. c^. c_. } #] -\test ##[ { c-_ c^_ c__ } #] -\test ##[ { c-\trill c^\trill c_\trill } #] -\test ##[ { c-1 c^2 c_3 } #] % FingerEvent -\test ##[ { c-"foo" c^"foo" c_"foo" } #] % TextScriptEvent -\test ##[ { R1*4-"foo" R^"foo" R_"foo" } #] % MultiMeasureTextEvent +\test ##[ { c: c:1 } #] % TremoloEvent +\test ##[ { c-^ c^^ c_^ } #] % ArticulationEvent +\test ##[ { c-+ c^+ c_+ } #] +\test ##[ { c-- c^- c_- } #] +\test ##[ { c-| c^| c_| } #] +\test ##[ { c-> c^> c_> } #] +\test ##[ { c-. c^. c_. } #] +\test ##[ { c-_ c^_ c__ } #] +\test ##[ { c-\trill c^\trill c_\trill } #] +\test ##[ { c-1 c^2 c_3 } #] % FingerEvent +\test ##[ { c-"foo" c^"foo" c_"foo" } #] % TextScriptEvent +\test ##[ { R1*4-"foo" R^"foo" R_"foo" } #] % MultiMeasureTextEvent \test ##[ { < c\harmonic >4 < c e\harmonic > } #] % HarmonicEvent -\test ##[ { c-\glissando c^\glissando c_\glissando } #] % GlissandoEvent -\test ##[ { c-\arpeggio c^\arpeggio c_\arpeggio } #] % ArpeggioEvent -\test ##[ { c\p c^\ff c_\sfz } #] % AbsoluteDynamicEvent -\test ##[ { c[ c] c^[ c^] c_[ c_] } #] % BeamEvent -\test ##[ { c( c) c^( c^) c_( c_) } #] % SlurEvent -\test ##[ { c\< c\! c^\< c^\! c_\< c_\! } #] % CrescendoEvent -\test ##[ { c\> c\! c^\> c^\! c_\> c_\! } #] % DecrescendoEvent -\test ##[ { c\episemInitium c\episemFinis } #] % EpisemaEvent -\test ##[ { c\( c\) c^\( c^\) c_\( c_\) } #] % PhrasingSlurEvent -\test ##[ { c\sustainOn c\sustainOff } #] % SustainEvent -\test ##[ { c\sostenutoOn c\sostenutoOff } #] % SostenutoEvent +\test ##[ { c-\glissando c^\glissando c_\glissando } #] % GlissandoEvent +\test ##[ { c-\arpeggio c^\arpeggio c_\arpeggio } #] % ArpeggioEvent +\test ##[ { c\p c^\ff c_\sfz } #] % AbsoluteDynamicEvent +\test ##[ { c[ c] c^[ c^] c_[ c_] } #] % BeamEvent +\test ##[ { c( c) c^( c^) c_( c_) } #] % SlurEvent +\test ##[ { c\< c\! c^\< c^\! c_\< c_\! } #] % CrescendoEvent +\test ##[ { c\> c\! c^\> c^\! c_\> c_\! } #] % DecrescendoEvent +\test ##[ { c\episemInitium c\episemFinis } #] % EpisemaEvent +\test ##[ { c\( c\) c^\( c^\) c_\( c_\) } #] % PhrasingSlurEvent +\test ##[ { c\sustainOn c\sustainOff } #] % SustainEvent +\test ##[ { c\sostenutoOn c\sostenutoOff } #] % SostenutoEvent \test ##[ \melisma #] \test ##[ \melismaEnd #] -\test ##[ { c\startTextSpan c\stopTextSpan } #] % TextSpanEvent -\test ##[ { c\startTrillSpan c\stopTrillSpan } #] % TrillSpanEvent -\test ##[ { c \startStaff c \stopStaff } #] % StaffSpanEvent -\test ##[ { c\startGroup c\stopGroup c^\startGroup c^\stopGroup c_\startGroup c_\stopGroup } #] % NoteGroupingEvent -\test ##[ { c\unaCorda c\treCorde } #] % UnaCordaEvent +\test ##[ { c\startTextSpan c\stopTextSpan } #] % TextSpanEvent +\test ##[ { c\startTrillSpan c\stopTrillSpan } #] % TrillSpanEvent +\test ##[ { c \startStaff c \stopStaff } #] % StaffSpanEvent +\test ##[ { c\startGroup c\stopGroup c^\startGroup c^\stopGroup c_\startGroup c_\stopGroup } #] % NoteGroupingEvent +\test ##[ { c\unaCorda c\treCorde } #] % UnaCordaEvent \test ##[ \breathe #] \test ##[ { c \[ c \] } #] % LigatureEvent \test ##[ \~ #] % PesOrFlexaEvent -\test ##[ { c-\bendAfter #3 } #] % BendAfterEvent +\test ##[ { c-\bendAfter #3 } #] % BendAfterEvent \test ##[ < c-\rightHandFinger #1 > #] % StrokeFingerEvent \test ##[ \break #] diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index 0c5673c824..ef2b5bd580 100644 --- a/scm/define-music-display-methods.scm +++ b/scm/define-music-display-methods.scm @@ -377,7 +377,7 @@ expression." (chord? (make-music-type-predicate 'EventChord)) (cluster? (make-music-type-predicate 'ClusterNoteEvent)) (note? (make-music-type-predicate 'NoteEvent))) - (format #f "~a~a{~v%~v_~{~a ~}~v%~v_}" + (format #f "~a~a{~v%~v_~{~a~^ ~}~v%~v_}" (if (any (lambda (e) (and (chord? e) (any cluster? (ly:music-property e 'elements)))) @@ -415,7 +415,7 @@ expression." (music->lily-string music parser)) elements)) (if force-line-break 1 0) - (if force-line-break (*indent*) 0)))) + (if force-line-break (*indent*) 1)))) (define-display-method SimultaneousMusic (sim parser) (parameterize ((*indent* (+ 3 (*indent*)))) @@ -473,7 +473,7 @@ Otherwise, return #f." ;; simple_element : note | figure | rest | mmrest | lyric_element | skip (let* ((simple-element (car simple-elements)) (duration (ly:music-property simple-element 'duration)) - (lily-string (format #f "~a~a~a~{~a ~}" + (lily-string (format #f "~a~a~a~{~a~^ ~}" (music->lily-string simple-element parser) (duration->lily-string duration) (if (and ((make-music-type-predicate 'RestEvent) simple-element) @@ -491,7 +491,7 @@ Otherwise, return #f." (post-events (filter post-event? elements))) (if (not (null? chord-elements)) ;; note_chord_element : '<' (notepitch | drumpitch)* '>" duration post_events - (let ((lily-string (format #f "< ~{~a ~}>~a~{~a ~}" + (let ((lily-string (format #f "< ~{~a ~}>~a~{~a~^ ~}" (map-in-order (lambda (music) (music->lily-string music parser)) chord-elements) @@ -503,13 +503,13 @@ Otherwise, return #f." (*previous-duration* (ly:music-property (car chord-elements) 'duration)) lily-string) ;; command_element - (format #f "~{~a ~}" (map-in-order (lambda (music) + (format #f "~{~a~^ ~}" (map-in-order (lambda (music) (music->lily-string music parser)) elements)))))))) (define-display-method MultiMeasureRestMusic (mmrest parser) (let* ((dur (ly:music-property mmrest 'duration)) - (ly (format #f "R~a~{~a ~}" + (ly (format #f "R~a~{~a~^ ~}" (duration->lily-string dur) (map-in-order (lambda (music) (music->lily-string music parser))