]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/snippets/centering-markup-on-note-heads-automatically.ly
LSR: Update.
[lilypond.git] / Documentation / snippets / centering-markup-on-note-heads-automatically.ly
index 509534a91b52878a72145a66ae105ac0012138cf..7e0caf90e1e73a28c4b41861e4d576536611e06a 100644 (file)
@@ -1,7 +1,7 @@
 %% Do not edit this file; it is automatically
 %% generated from LSR http://lsr.dsi.unimi.it
 %% This file is in the public domain.
-\version "2.13.4"
+\version "2.13.10"
 
 \header {
   lsrtags = "text, tweaks-and-overrides"
@@ -24,20 +24,15 @@ textScriptCenterOnNote = \override TextScript #'X-offset =
 #(lambda (grob)
    (let* ((paper-col (ly:grob-parent grob X))
           (elts (ly:grob-object paper-col 'elements))
-          (rhythmic-head
-           (if (ly:grob-array? elts)
-               (let loop ((array-idx 0))
-                 (call/cc
-                  (lambda (return)
-                    (let ((array-len (ly:grob-array-length elts)))
-                      (if (< array-idx (1- array-len))
-                          (let ((elt (ly:grob-array-ref elts array-idx)))
-                            (if (grob::has-interface elt
-                                                     'rhythmic-head-interface)
-                                (return elt)
-                                (loop (1+ array-idx)))))
-                      grob))))
-               grob)))
+          (rhythmic-head grob))
+
+     (for-each
+      (lambda (idx)
+        (let ((elt (ly:grob-array-ref elts idx)))
+          (if (grob::has-interface elt
+                                   'rhythmic-grob-interface)
+              (set! rhythmic-head elt))))
+      (reverse (iota (ly:grob-array-length elts))))
 
      (+
       (ly:self-alignment-interface::x-aligned-on-self grob)