lilypond-devel
[Top][All Lists]
Advanced

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

command_replace function (was: Re: difference betwwen \pad-around and \p


From: Mark Polesky
Subject: command_replace function (was: Re: difference betwwen \pad-around and \pad-markup?)
Date: Wed, 12 Aug 2009 11:31:33 -0700 (PDT)

Carl Sorensen wrote:
> Even better would be to define a function:
> def command_replace(old_command, new_command, str)
> that could then be used in a convert-ly rule
> str = command_replace ("pad-markup", "pad-around", str)
>
> so that in the future you'd never have to worry about dealing
> with word boundaries, etc.  This was something Graham asked for
> a couple of months ago, but it never got added.  If you wanted
> to do this as part of your project, it would be great.

Yes, the idea was that the python function would add "\\" and "\b"
appropriately, but at least one gotcha has been mentioned (by
Neil):

For each builtin markup-command, the define-builtin-markup-command
macro (line 48 of markup.scm) generates a "make-COMMAND-markup",
which wouldn't be converted if the rule mandates "\\".

I presume that this wouldn't be a big deal to accommodate, but I
have no idea how many other gotchas there are. This one is markup-
specific, but I imagine there are plenty of other similar traps.

Anyone have an idea how to find the other "traps"? Could there be
a  systematic approach?
- Mark


      




reply via email to

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