]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/markup.scm
Run grand-replace (issue 3765)
[lilypond.git] / scm / markup.scm
index 69a6ad13ffaf886912531f7704772e34a9fc7025..d323ad3b4235f27f2eff9332b33e4eca7e720ebb 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2003--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2003--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
@@ -48,16 +48,13 @@ Example:
 (define-public interpret-markup ly:text-interface::interpret-markup)
 
 (define-public (interpret-markup-list layout props markup-list)
-  ;; 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)))
+  (fold-right
+   (lambda (m prev)
+     (if (markup-command-list? m)
+         (append (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)))