lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rewriting an expression that uses ly:make-simple-closure


From: David Kastrup
Subject: Re: Rewriting an expression that uses ly:make-simple-closure
Date: Thu, 07 Jan 2016 22:59:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Paul Morris <address@hidden> writes:

> Hi all,  Here’s a tricky one…  I’m working on updating a piece from the 
> Mutopia Project[1] (from LilyPond 2.16.1 to 2.19.35) and it uses the 
> following:
>
> centermarkup = {
>   \once \override TextScript.self-alignment-X = #CENTER
>   \once \override TextScript.X-offset =#(ly:make-simple-closure
>     `(,+
>       ,(ly:make-simple-closure (list
>         ly:self-alignment-interface::centered-on-x-parent))
>       ,(ly:make-simple-closure (list
>         ly:self-alignment-interface::x-aligned-on-self))))
> }
>
> But ly:make-simple-closure is no longer around[2].  So how to rewrite this 
> without it?
>
> It seems to be documented (barely) in the 2.18 extending manual:
> http://www.lilypond.org/doc/v2.18/Documentation/extending/callback-functions.html
>
> Looking in the source code I find the example given there from 
> define-grobs.scm:
>
> (X-offset . ,(ly:make-simple-closure
>                       `(,+
>                         ,(ly:make-simple-closure
>                           (list 
> ly:self-alignment-interface::centered-on-x-parent))
>                         ,(ly:make-simple-closure
>                           (list 
> ly:self-alignment-interface::x-aligned-on-self)))))
>
> and see it has now become the following in 2.19.35:
>
> (X-offset . ,ly:self-alignment-interface::aligned-on-x-parent)

It's probably the same if parent-alignment-X is set to ,CENTER as well.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]