lilypond-user
[Top][All Lists]
Advanced

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

Re: Markup in TextSpanner edge-text


From: Nicolas Sceaux
Subject: Re: Markup in TextSpanner edge-text
Date: Sat, 13 Aug 2005 13:05:59 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

Bertalan Fodor <address@hidden> writes:

> Hello, I'm trying:
>
> \override TextSpanner #'edge-text = #'( \markup "rit" . "")
> \override TextSpanner #'edge-text = #'( (markup "rit") . "")
> \override TextSpanner #'edge-text = #'( (make-simple-markup "rit") . "")
>
> But none of them works: all of them writes nothing.
>
> Can you provide any help achieving this?

Graham told you how to do this. Let's see why what you tried was wrong.

After a sharp '#' character, the parser expects a scheme form. Let's see
what scheme forms you entered.

guile> '(\markup "rit" . "")
(\markup "rit" . "")

You can see the symbol \markup, the string "rit" and the string
"". Obviously, this is not a cons cell containing two markups or
strings.

guile> '((markup "rit") . "")
((markup "rit") . "")

Here you see a cons cell, which car is the literal list (markup "rit"),
and which cdr is the string "". The literal list (markup "rit") is not a
markup: indeed, a markup is a list made of a markup command and its
arguments, whereas (markup "rit") is a list made of a symbol and a
string.
For the same reason, the literal list (make-simple-markup "rit"), made
of a symbol and a string, is not a markup.

The quote that you used just after the # prevents its argument to be
evaluated. Here, you want the form (markup "rit") to be evaluated, so
you cannot use quote. Instead, you have to build the cons cell with the
`cons' function:

guile> (cons (markup "rit") "")
((#<procedure line-markup (layout props args)> ((#<procedure simple-markup 
(layout props str)> "rit"))) . "")

Here, the car of the cons cell that you built *is* a markup : a list
made of a markup command, named `line-markup', and its argument, a
list of markups.

Another mean to use something like quote and have some forms evaluated
is to use backquote and comma: `(,(markup "rit") . "")

guile> `(,(markup "rit") . "")
((#<procedure line-markup (layout props args)> ((#<procedure simple-markup 
(layout props str)> "rit"))) . "")

nicolas




reply via email to

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