lilypond-user
[Top][All Lists]

## Re: Let's make TextSpanners easier to use!

 From: Valentin Villenave Subject: Re: Let's make TextSpanners easier to use! Date: Wed, 29 Oct 2008 23:50:40 +0100

```2008/10/29 Neil Puttock <address@hidden>:

> Looks good. :)

Thanks!

> As a minor refinement, you could use assoc-get instead of assoc.

??
guile> (help assoc-get)
Did not find any object named `assoc-get'
guile>

> Hmm, this isn't as elegant as make-text-span itself; you can't use markup.

Do you know how I could (other than using (ly:markup?))?

> It's a bit academic now, but concerning your problem with passing the
> text variable in the original example, you need to use a backquote for
> the bound-details, together with a comma before txt; this ensures that
> the value of txt is substituted in the list, rather than returning the
> symbol.

OK. I have to confess I haven't understood yet how the backquote
works. IIUC, it 'quotes all the keys in the alist, and then I have to
,unquote the ones i want to actually use as variables?

> You can see the same syntax in define-grobs.scm for grob callbacks.

Yes I can (but then again, seeing is not necessarily understanding :)

Would you, by any chance, have an idea about how to make it possible to have

c1\startSpan "spanner attached to note" c1\endSpan

without using a music function?

(If you do have an idea, this would also be useful for Graham's
compound dynamics.)

Hmm, I suspect it would probably require a new
ly:make-attached-function C++ implementation, since currently the only
way we have to take an argument is through a music-function, which
thereby obliges us to enter it *before* the note (and not after like
normal dynamics or spanners).

Cheers,
Valentin

```