lilypond-user
[Top][All Lists]
Advanced

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

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


From: Richard Shann
Subject: ly:expect-warning (was Re: Slur from one voice to another emits warning)
Date: Mon, 05 Jun 2017 16:42:28 +0100

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?

As an aside:
The documentation is somewhat sparse:

Function: ly:expect-warning 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 message should be
translated with (_ ...) and changing parameters given after the format
string. 

from this I gather that the parameter "str" is a Scheme format string
(as expected by the Scheme format procedure I guess) and rest would be
needed if there were ~'s in the format string. In which case the
documentation shouldn't say "The message should be translated with ..."
but that the parameter "str" should be the English format string for the
error message enclosed with (_ ).


Richard









reply via email to

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