lilypond-user
[Top][All Lists]
Advanced

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

Re: ly:expect-warning (was Re: Slur from one voice to another emits warn


From: David Kastrup
Subject: Re: ly:expect-warning (was Re: Slur from one voice to another emits warning)
Date: Mon, 05 Jun 2017 18:34:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Richard Shann <address@hidden> writes:

> On Sun, 2017-06-04 at 17:48 +0200, Simon Albrecht wrote:
>> On 04.06.2017 15:50, Knute Snortum wrote:
>> > I post to Mutopia so I can't have warnings.  Any thoughts?
>> 
>> Sometimes one has to accept warnings, so in future situations 
>> ly:expect-warning might be your friend (unless it is banned from 
>> Mutopia? I’d be surprised). It only needs the beginning of the warning 
>> string, like
>> #(ly:expect-warning "cannot have")
>
> Simon - I was intrigued by this comment of yours and wondered if you
> could say where this bit of Scheme needs to be placed?.
> I tried to suppress clashing note column warnings thus:
>
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> \version "2.18.0"
> #(ly:expect-warning (_ "ignoring too many clashing note columns")) 
> MvmntIVoiceI = {
>          #(ly:expect-warning (_ "ignoring too many clashing note columns")) 
>          c''4 c'' c'' 
> }
> MvmntIVoiceII = {
>          #(ly:expect-warning (_ "ignoring too many clashing note columns")) 
>          c''4 c'' c'' 
> }
> \score {
>         \new Staff = "Part 1"  << 
>                                    \new Voice = "MvmntIVoiceI"  \MvmntIVoiceI 
>  
>                                    \new Voice = "MvmntIVoiceII"     
> \MvmntIVoiceII 
>                                 >> 
>        } 
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
>
> I found by trial-and-error that if I remove any of the three occurrences
> of the ly:expect-warning the warning returns.
>
> Where should it be called?

At the top, once for every expected warning.  It doesn't make sense
placing it in music expressions: its effect will be immediate anyway and
it does not become part of the music.

But you need to expect the right order and number of warnings.

-- 
David Kastrup



reply via email to

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