From: David Kastrup <dak@gnu.org>
Date: Mon, 6 Feb 2012 10:22:37 +0000 (+0100)
Subject: Replace duration-of-note with a more simple-minded variant working for chord repeats... 
X-Git-Tag: release/2.15.29-1~18
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4faa2f72246a1061a095dac7d7389bb3c24d663e;p=lilypond.git

Replace duration-of-note with a more simple-minded variant working for chord repeats as well
---

diff --git a/scm/music-functions.scm b/scm/music-functions.scm
index 4586fbfb66..1666084735 100644
--- a/scm/music-functions.scm
+++ b/scm/music-functions.scm
@@ -1581,13 +1581,16 @@ Entries that conform with the current key signature are not invalidated."
 	 (ly:music-property (car evs) 'pitch))))
 
 (define-public (duration-of-note event-chord)
-  (let ((evs (filter (lambda (x)
-		       (music-has-type x 'rhythmic-event))
-		     (cons event-chord
-			   (ly:music-property event-chord 'elements)))))
-
-    (and (pair? evs)
-	 (ly:music-property (car evs) 'duration))))
+  (cond
+   ((pair? event-chord)
+    (or (duration-of-note (car event-chord))
+	(duration-of-note (cdr event-chord))))
+   ((ly:music? event-chord)
+    (let ((dur (ly:music-property event-chord 'duration)))
+      (if (ly:duration? dur)
+	  dur
+	  (duration-of-note (ly:music-property event-chord 'elements)))))
+   (else #f)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;