[Top][All Lists]

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

Re: Trouble defining markup functiion

From: David Kastrup
Subject: Re: Trouble defining markup functiion
Date: Thu, 17 Jan 2019 21:16:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Carl Sorensen <address@hidden> writes:

> On 1/17/19, 8:02 AM, "David Kastrup" <address@hidden> wrote:
>     >
>     > I've used displayScheme to get the representation of the markup
>     > function.  I've found that is uses #:line so that I have to use
>     > make-line-markup.
>     #:sans is garbage outside of the markup macro.  Also make-line-markup
>     requires a list as its argument.
> That's what I thought, but I couldn't find it documented.

It's probably more implied than documented.

>     Your original
>     \markup{\sans{\fontsize #10 "C"}}
>     contains two levels of spurious braces.  Those generate spurious markup
>     lists causing LilyPond to intersperse a \line call for converting back
>     to a single markup.
> I thought I copied that code from the NR, but I can't find it, so I
> must not have.

Or it has been simplified in the mean time.

>     Any reason you don't use #{ \markup ... #} for constructing your markup?
>     That way you don't need to replace LilyPond's expertise for constructing
>     markups with your own.
> Only because of ignorance.  The last time I spent serious time writing
> markup functions, #{ ... #} wasn't available.

For markups.

> Thanks for pointing it out to me, and again reminding me how much your
> work has improved the usability of LilyPond!

Well, this approach calls the parser at runtime.  Certainly less
efficient than calling a macro (which usually is already called at
compile time anyway).

This does not really increase usability (you cannot actually do more
than you could do without) but it does lower the barrier of entry and
gives more experienced developers a chance to "solve" other people's
problems in a manner where they don't need to frequently visit the
mailing lists for what amounts to elaboration on the same kind of
question.  Which does improve the usability of the mailing lists.

Basically it's flush mounting of LilyPond's wiring.  More complex than
on-wall mounting, worse when maintenance is needed, but users don't keep
stumbling over and tearing stuff.  Until they try hanging up pictures,
of course.

David Kastrup

reply via email to

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