]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #1540: correct display method for single note chords.
authorNeil Puttock <n.puttock@gmail.com>
Tue, 1 Mar 2011 23:35:32 +0000 (23:35 +0000)
committerNeil Puttock <n.puttock@gmail.com>
Tue, 1 Mar 2011 23:35:32 +0000 (23:35 +0000)
* input/regression/display-lily-tests.ly:

  add test for EventChord with single NoteEvent and post_events

* scm/define-music-display-methods.scm (EventChord display method):

  use post-event? predicate to filter 'articulations

input/regression/display-lily-tests.ly
scm/define-music-display-methods.scm

index c28ebf7e3bf15263341e92e62a1120080c149723..e435730ab232ab22cbc1b642fc098300054713a9 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.13.20"
+\version "2.13.53"
 #(use-modules (srfi srfi-13)
               (ice-9 format))
 
@@ -76,6 +76,7 @@ stderr of this run."
 \test "" ##[ R1.*2/3 #]                % MultiMeasureRestMusicGroup, MultiMeasureRestEvent
 \test "" ##[ \skip 2.*3/4 #]           % SkipMusic
 \test "" ##[ < c\1 e\3 >4.*3/4-. #]    % EventChord, NoteEvent, StringNumberEvent, ArticulationEvent
+\test "" ##[ < c-1\4 >8 #]
 \test "NOT A BUG" ##[ { < c e g c' > q8-. } #] % RepeatedChord
 
 %% tags
index 574ba04678a4aaae15d77b0c89ce76c5e72df5d5..2440e15bea791191bd9104a06cb589e9852395ad 100644 (file)
@@ -457,11 +457,11 @@ Otherwise, return #f."
        (music->lily-string (car elements) parser)
        (if (and (not (null? simple-elements))
                 (null? (cdr simple-elements))
-                ;; special case: if this simple_element has a HarmonicEvent in its
-                ;; 'articulations list, it should be interpreted instead as a
-                ;; note_chord_element, since \harmonic only works inside chords,
-                ;; even for single notes, e.g., < c\harmonic >
-                (null? (filter (make-music-type-predicate 'HarmonicEvent)
+                ;; special case: if this simple_element has any post_events in
+                ;; its 'articulations list, it should be interpreted instead
+                ;; as a note_chord_element to prevent spurious output, e.g.,
+                ;; \displayLilyMusic < c-1\4 >8 -> c-1\48
+                (null? (filter post-event?
                                (ly:music-property (car simple-elements) 'articulations))))
            ;; simple_element : note | figure | rest | mmrest | lyric_element | skip
            (let* ((simple-element (car simple-elements))