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: Richard Shann
Subject: Re: ly:expect-warning (was Re: Slur from one voice to another emits warning)
Date: Tue, 06 Jun 2017 08:10:41 +0100

On Mon, 2017-06-05 at 18:34 +0200, David Kastrup wrote:
> 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.

Ah, repeated calls to ly:expect-warning increment a counter for the
number of such warnings to be expected.
Thanks very much for this information.

Suggested update to docs:

Function: ly:expect-warning format-str rest

    A Scheme callable function to register a warning to be expected and
subsequently suppressed. If the warning is not encountered, a warning
about the missing warning will be shown. The format-str should be
translated with (_ ...) and rest should be any parameters expected by
format-str. The number and ordering of calls should match the number and
order of warnings to be suppressed.

Richard




reply via email to

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