lilypond-devel
[Top][All Lists]
Advanced

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

markups in scheme


From: Han-Wen Nienhuys
Subject: markups in scheme
Date: Sun, 3 Aug 2003 03:01:44 +0200

address@hidden writes:
> Hello,
> 
> Having upgraded from 1.6 to 1.7.something, I had a look to the new
> markups, as many messages in this list reported that it was a big
> improvement. (They were not lying.)
> 
> I looked for a scheme user interface, so that I could build markups in
> scheme functions. In a comment, it is said that is left as an exercise
> to the reader. But maybe I missed something?


Dunno. I suppose it as an excercise for the more advanced reader ;-)

The comment refers to writing new XXX-markup functions that are
recognized as \XXX by the parser.

The idea is that you do

        #(define-public (XXX-markup grob props . rest)
          (interpret-markup  grob
           (cons (cons font-shape italic) props)
           (car rest)))
        #(set-object-property! XXX-markup 'markup-signature '(markup))
        #(set-object-property! xXX-markup 'markup-keyword 'markup0)

The problem is that (lookup-markup-command) only looks for XXX in the
new-markup.scm module. It should take optional arguments to lookup XXX
in different modules (such as the one for the currently translated .ly
file). Of course, if you write them as Scheme, you do not have to
worry about any macros.

> Anyway, I have written a `markup' macro in scheme, which builds text
> [..]
> 
> \markup \translate #(cons -3 2) { \large \bold "Cesare." }
> \markup \translate #(cons -3 2) { \large \bold "Cleopatra" 
>                                   \italic "(entra.)" }


Wow, impressive stuff!

I have to admit, I don't know how to write Scheme macros, so I am
easily impressed :-)


-- 

Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 




reply via email to

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