Expect a warning several times: Difference between revisions
Appearance
Scheme function to suppress several warnings |
Rudi Guggt (talk | contribs) link to documentation |
||
| Line 12: | Line 12: | ||
<code>#(expect-warning-times 4 "omitting tuplet bracket")</code> | <code>#(expect-warning-times 4 "omitting tuplet bracket")</code> | ||
The hint from the documentation: [https://lilypond.org/doc/v2.25/Documentation/internals/scheme-functions scheme-functions] | |||
Revision as of 09:09, 28 February 2026
There are times when your LilyPond source file prints warnings when compiled and you may want to suppress these warnings from the output. LilyPond has a Scheme function for this: ly:expect-warning. However, there are times when the same warning is printed several times and ly:expect-warning will only hide one warning at a time. Typing this function several times in a row is tedious.
The Scheme function below takes a string that will match some part of the warning, just like ly:expect-warning, but it also takes an integer for the number of times the warning is printed.
#(define expect-warning-times (lambda args
(for-each (lambda _ (apply ly:expect-warning (cdr args)))
(iota (car args)))))
A usage example:
#(expect-warning-times 4 "omitting tuplet bracket")
The hint from the documentation: scheme-functions