|
|
DescriptionIssue #5246: Make empty scores abort engraving process
This change makes the "no music" warning fatal during the output
process.
Issue: 5246
Patch Set 1 #
MessagesTotal messages: 6
It's a bit odd to announce successful engraving of nothing.
Sign in to reply to this message.
On Dec 21, 2017, at 23:06, beauleetienne0@gmail.com wrote: > > @@ -110,8 +110,7 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression", > > if (!iter->ok ()) > { > - warning (_ ("no music found in score")); > - /* todo: should throw exception. */ > + error (_ ("no music found in score")); > return SCM_BOOL_F; > } Looking at this in isolation, I wonder whether “no music found” is the only reason that iter might not be OK; in other words, was the message appropriate before you arrived? Regards, — Dan
Sign in to reply to this message.
Dan Eble <dan@faithful.be> writes: > On Dec 21, 2017, at 23:06, beauleetienne0@gmail.com wrote: >> >> @@ -110,8 +110,7 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression", >> >> if (!iter->ok ()) >> { >> - warning (_ ("no music found in score")); >> - /* todo: should throw exception. */ >> + error (_ ("no music found in score")); >> return SCM_BOOL_F; >> } > > Looking at this in isolation, I wonder whether “no music found” is the > only reason that iter might not be OK; in other words, was the message > appropriate before you arrived? \new Voice { } _is_ arguably music. The other error message before is actually just nonsensical since LY_ASSERT_SMOB already catches the respective condition. I think we should just let this one complete properly (and thus also get an image/PDF) though with a warning. I actually thought I did change this at one time. At any rate, a _fatal_ error at least seems silly. There is no reason not to continue here. -- David Kastrup
Sign in to reply to this message.
Am 22. Dezember 2017 15:42:39 MEZ schrieb David Kastrup <dak@gnu.org>: >Dan Eble <dan@faithful.be> writes: > >> On Dec 21, 2017, at 23:06, beauleetienne0@gmail.com wrote: >>> >>> @@ -110,8 +110,7 @@ LY_DEFINE (ly_interpret_music_expression, >"ly:interpret-music-expression", >>> >>> if (!iter->ok ()) >>> { >>> - warning (_ ("no music found in score")); >>> - /* todo: should throw exception. */ >>> + error (_ ("no music found in score")); >>> return SCM_BOOL_F; >>> } >> >> Looking at this in isolation, I wonder whether “no music found” is >the >> only reason that iter might not be OK; in other words, was the >message >> appropriate before you arrived? > >\new Voice { } > >_is_ arguably music. The other error message before is actually just >nonsensical since LY_ASSERT_SMOB already catches the respective >condition. I think we should just let this one complete properly (and >thus also get an image/PDF) though with a warning. > >I actually thought I did change this at one time. At any rate, a >_fatal_ error at least seems silly. There is no reason not to continue >here. Yes, there may be valid reasons to compile files with no music in them. Urs > >-- >David Kastrup > >_______________________________________________ >lilypond-devel mailing list >lilypond-devel@gnu.org >https://lists.gnu.org/mailman/listinfo/lilypond-devel -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
Sign in to reply to this message.
Urs Liska <lists@ursliska.de> writes: > Am 22. Dezember 2017 15:42:39 MEZ schrieb David Kastrup <dak@gnu.org>: >>Dan Eble <dan@faithful.be> writes: >> >>> On Dec 21, 2017, at 23:06, beauleetienne0@gmail.com wrote: >>>> >>>> @@ -110,8 +110,7 @@ LY_DEFINE (ly_interpret_music_expression, >>"ly:interpret-music-expression", >>>> >>>> if (!iter->ok ()) >>>> { >>>> - warning (_ ("no music found in score")); >>>> - /* todo: should throw exception. */ >>>> + error (_ ("no music found in score")); >>>> return SCM_BOOL_F; >>>> } >>> >>> Looking at this in isolation, I wonder whether “no music found” is >>the >>> only reason that iter might not be OK; in other words, was the >>message >>> appropriate before you arrived? >> >>\new Voice { } >> >>_is_ arguably music. The other error message before is actually just >>nonsensical since LY_ASSERT_SMOB already catches the respective >>condition. I think we should just let this one complete properly (and >>thus also get an image/PDF) though with a warning. >> >>I actually thought I did change this at one time. At any rate, a >>_fatal_ error at least seems silly. There is no reason not to continue >>here. > > Yes, there may be valid reasons to compile files with no music in them. This actually doesn't trigger for files with no music in them but for music with no (iterable) music in it. -- David Kastrup
Sign in to reply to this message.
David Kastrup <dak@gnu.org> writes: > Urs Liska <lists@ursliska.de> writes: > >> Am 22. Dezember 2017 15:42:39 MEZ schrieb David Kastrup <dak@gnu.org>: >>>Dan Eble <dan@faithful.be> writes: >>> >>>> On Dec 21, 2017, at 23:06, beauleetienne0@gmail.com wrote: >>>>> >>>>> @@ -110,8 +110,7 @@ LY_DEFINE (ly_interpret_music_expression, >>>"ly:interpret-music-expression", >>>>> >>>>> if (!iter->ok ()) >>>>> { >>>>> - warning (_ ("no music found in score")); >>>>> - /* todo: should throw exception. */ >>>>> + error (_ ("no music found in score")); >>>>> return SCM_BOOL_F; >>>>> } >>>> >>>> Looking at this in isolation, I wonder whether “no music found” is >>>the >>>> only reason that iter might not be OK; in other words, was the >>>message >>>> appropriate before you arrived? >>> >>>\new Voice { } >>> >>>_is_ arguably music. The other error message before is actually just >>>nonsensical since LY_ASSERT_SMOB already catches the respective >>>condition. I think we should just let this one complete properly (and >>>thus also get an image/PDF) though with a warning. >>> >>>I actually thought I did change this at one time. At any rate, a >>>_fatal_ error at least seems silly. There is no reason not to continue >>>here. >> >> Yes, there may be valid reasons to compile files with no music in them. > > This actually doesn't trigger for files with no music in them but for > music with no (iterable) music in it. Actually, if I remove the premature return, I get for \new Voice {} -*- mode: compilation; default-directory: "/tmp/" -*- Compilation started at Fri Dec 22 16:10:13 /usr/local/tmp/lilypond/out/bin/lilypond blabla.ly GNU LilyPond 2.21.0 Processing `blabla.ly' Parsing... blabla.ly:1: warning: no \version statement found, please add \version "2.21.0" for future compatibility Interpreting music... warning: no music found in score [0] Preprocessing graphical objects... programming error: No spring between column 0 and next one continuing, cross fingers programming error: No spring between column 0 and next one continuing, cross fingers programming error: didn't find a vertical alignment in this system continuing, cross fingers programming error: No spring between column 0 and next one continuing, cross fingers Finding the ideal number of pages... Fitting music on 1 page... Drawing systems... programming error: No spring between column 0 and next one continuing, cross fingers programming error: system with empty extent continuing, cross fingers Layout output to `/tmp/lilypond-vZDPJH'... Converting to `blabla.pdf'... Deleting `/tmp/lilypond-vZDPJH'... Success: compilation successfully completed Compilation finished at Fri Dec 22 16:10:14 and a visibly empty file (no idea whether there is off-screen material getting typeset). So that's not particularly useful but at least it touches the PDF file. -- David Kastrup
Sign in to reply to this message.
|