+\f
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Markup list commands
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define-public (space-lines baseline stils)
+ (let space-stil ((stils stils)
+ (result (list)))
+ (if (null? stils)
+ (reverse! result)
+ (let* ((stil (car stils))
+ (dy-top (max (- (/ baseline 1.5)
+ (interval-bound (ly:stencil-extent stil Y) UP))
+ 0.0))
+ (dy-bottom (max (+ (/ baseline 3.0)
+ (interval-bound (ly:stencil-extent stil Y) DOWN))
+ 0.0))
+ (new-stil (ly:make-stencil
+ (ly:stencil-expr stil)
+ (ly:stencil-extent stil X)
+ (cons (- (interval-bound (ly:stencil-extent stil Y) DOWN)
+ dy-bottom)
+ (+ (interval-bound (ly:stencil-extent stil Y) UP)
+ dy-top)))))
+ (space-stil (cdr stils) (cons new-stil result))))))
+
+(define-builtin-markup-list-command (justified-lines layout props args)
+ (markup-list?)
+ ((baseline-skip)
+ wordwrap-internal-markup-list)
+ "
+@cindex justifying lines of text
+
+Like @code{\\justify}, but return a list of lines instead of a single markup.
+Use @code{\\override-lines #'(line-width . @var{X})} to set the line width;
+@var{X}@tie{}is the number of staff spaces."
+ (space-lines baseline-skip
+ (interpret-markup-list layout props
+ (make-wordwrap-internal-markup-list #t args))))
+
+(define-builtin-markup-list-command (wordwrap-lines layout props args)
+ (markup-list?)
+ ((baseline-skip)
+ wordwrap-internal-markup-list)
+ "Like @code{\\wordwrap}, but return a list of lines instead of a single markup.
+Use @code{\\override-lines #'(line-width . @var{X})} to set the line width,
+where @var{X} is the number of staff spaces."
+ (space-lines baseline-skip
+ (interpret-markup-list layout props
+ (make-wordwrap-internal-markup-list #f args))))
+
+(define-builtin-markup-list-command (column-lines layout props args)
+ (markup-list?)
+ ((baseline-skip))
+ "Like @code{\\column}, but return a list of lines instead of a single markup.
+@code{baseline-skip} determines the space between each markup in @var{args}."
+ (space-lines (chain-assoc-get 'baseline-skip props)
+ (interpret-markup-list layout props args)))
+
+(define-builtin-markup-list-command (override-lines layout props new-prop args)
+ (pair? markup-list?)
+ ()
+ "Like @code{\\override}, for markup lists."
+ (interpret-markup-list layout (cons (list new-prop) props) args))