lilypond-user
[Top][All Lists]
Advanced

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

Re: Combining multiple markups into a single, word-wrappable one?


From: David Kastrup
Subject: Re: Combining multiple markups into a single, word-wrappable one?
Date: Tue, 28 Jul 2020 23:24:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Aaron Hill <lilypond@hillvisions.com> writes:

> On 2020-07-28 10:15 am, David Kastrup wrote:
>> Aaron Hill <lilypond@hillvisions.com> writes:
>> 
>>> Feels like a hack, but would this help?
>>> %%%%
>>> \version "2.20.0"
>>> loremIpsum = \markuplist {
>>>   \bold { Lorem ipsum } dolor sit amet,
>>>   \italic consectetur adipiscing elit.
>>> }
>>> \markup {
>>>   \override #'(line-width . 40)
>>>   \wordwrap { $@loremIpsum $@loremIpsum $@loremIpsum }
>>> }
>>> %%%%
>> Why $@loremIpsum rather than \loremIpsum ?
>
> Because it does not work:
>
> ====
> GNU LilyPond 2.20.0
> Processing `markuplist.ly'
> Parsing...
> markuplist.ly:11:39: error: not a markup
>   \wordwrap { \loremIpsum \loremIpsum
>                                       \loremIpsum }
> /usr/local/lilypond/usr/share/lilypond/current/scm/lily.scm:1093:21:
> In procedure reverse! in expression (ly:parse-file file-name):
> /usr/local/lilypond/usr/share/lilypond/current/scm/lily.scm:1093:21:
> Wrong type argument in position 1: ("" (#<procedure bold-markup
> (layout props arg)> "Lorem") "elit." "adipiscing" (#<procedure
> italic-markup (layout props arg)> "consectetur") "amet," "sit" "dolor"
> (#<procedure bold-markup (layout props arg)> "ipsum") . #-7#)
> ====
>
>
> -- Aaron Hill

Ouch.  It does work.  Once.  You call \loremIpsum more than once.
LilyPond operates under the premise "I can destroy input since it either
exists only once or is a copy" which is correct for music expressions.
But \loremIpsum does not create a copy.  There is no copying guarantee
for non-music expressions in that manner.

I have to see where we mess with markup expression input in that manner.
Hopefully not in too many places.

So basically: it is supposed to work, but if people work around bugs (on
the assumption that LilyPond is weird enough that bombing out with some
strange error message on sane looking input means the user made a
mistake) rather than reporting them, stuff like this can go unnoticed
for long amounts of time.

-- 
David Kastrup



reply via email to

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