]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/markup.scm
Doc: typo
[lilypond.git] / scm / markup.scm
index 31bbaeeb420bb2d76373fb7d3a0551e40e9739eb..9253c378db998950de8cb4bdb3ee1a56f36575ee 100644 (file)
@@ -48,21 +48,23 @@ Example:
 (define-public interpret-markup ly:text-interface::interpret-markup)
 
 (define-public (interpret-markup-list layout props markup-list)
-  (let ((stencils (list)))
-    (for-each (lambda (m)
-                (set! stencils
-                      (if (markup-command-list? m)
-                          (append! (reverse! (apply (car m) layout props (cdr m)))
-                                   stencils)
-                          (cons (interpret-markup layout props m) stencils))))
-              markup-list)
-    (reverse! stencils)))
+  ;; This relies on the markup list returned by a markup list command
+  ;; to be modifiable
+  (reverse!
+   (fold
+    (lambda (m prev)
+      (if (markup-command-list? m)
+          (reverse! (apply (car m) layout props (cdr m)) prev)
+          (cons (interpret-markup layout props m) prev)))
+    '()
+    markup-list)))
 
 (define-public (prepend-alist-chain key val chain)
   (cons (acons key val (car chain)) (cdr chain)))
 
 (define-public (stack-stencil-line space stencils)
-  "DOCME"
+  "Adjoin a list of STENCILS along the X axis, leaving SPACE between the
+   end of each stencil and the reference point of the following stencil."
   (if (and (pair? stencils)
            (ly:stencil? (car stencils)))
 
@@ -70,7 +72,7 @@ Example:
                (ly:stencil? (cadr stencils)))
           (let* ((tail (stack-stencil-line space (cdr stencils)))
                  (head (car stencils))
-                 (xoff (+ space (interval-length (ly:stencil-extent head X)))))
+                 (xoff (+ space (interval-end (ly:stencil-extent head X)))))
             (ly:stencil-add head
                             (ly:stencil-translate-axis tail xoff X)))
           (car stencils))