lilypond-user
[Top][All Lists]
Advanced

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

Re: ly:expect-warning not working


From: Aaron Hill
Subject: Re: ly:expect-warning not working
Date: Sat, 28 Sep 2019 16:42:09 -0700
User-agent: Roundcube Webmail/1.3.8

On 2019-09-28 4:09 pm, Knute Snortum wrote:
I haven't been able to get the ly:expect-warning function working
properly.  Here is a MWE:

%%% Start
\version "2.19.83"
\include "english.ly"

#(ly:expect-warning "omitting tuplet bracket")

{
  \clef bass
  \tuplet 3/2 4 {
    <<
      { g4 s8 gf4 s8 f4 s8 s4. }
      \\
      { g8 ef' bf gf ef' bf f ef' a, bf, df' bf }
    >> |
  }
}
%%% End

This will still emit warnings for me. I'm on Ubuntu 19.04 if that matters.

As implemented, ly:expect-warning is to be used for individual occurrences of a warning, not as a simple global filter.

Try this variation on the function that makes it easy to specify how many instances of the warning should be expected:

%%%%
\version "2.19.83"
\include "english.ly"

#(define ly:expect-warning-times (lambda args
  (for-each (lambda _ (apply ly:expect-warning (cdr args)))
            (iota (car args)))))

#(ly:expect-warning-times 4 "omitting tuplet bracket")

{
  \clef bass
  \tuplet 3/2 4 {
    <<
      { g4 s8 gf4 s8 f4 s8 s4. }
      \\
      { g8 ef' bf gf ef' bf f ef' a, bf, df' bf }
    >> |
  }
}
%%%%


-- Aaron Hill



reply via email to

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