[Top][All Lists]

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

Re: New Issue: Disallow uncontained context-spec-music on top level

From: Simon Albrecht
Subject: Re: New Issue: Disallow uncontained context-spec-music on top level
Date: Wed, 23 Sep 2015 17:34:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 23.09.2015 16:52, David Kastrup wrote:
Simon Albrecht <address@hidden> writes:



$ git grep'= #(context-spec-music'
Documentation/snippets/additional-voices-to-avoid-collisions.ly:voiceFive=  #(co
ly/declarations-init.ly:melisma=  #(context-spec-music (make-property-set 'melis
ly/declarations-init.ly:melismaEnd=  #(context-spec-music (make-property-unset '
ly/property-init.ly:voiceOne=  #(context-spec-music (make-voice-props-set 0)
ly/property-init.ly:voiceTwo=  #(context-spec-music (make-voice-props-set 1)
ly/property-init.ly:voiceThree=  #(context-spec-music (make-voice-props-set 2)
ly/property-init.ly:voiceFour=  #(context-spec-music (make-voice-props-set 3)
ly/property-init.ly:oneVoice=  #(context-spec-music (make-voice-props-revert)
doesn’t deceive me, there are seven commands which output

It’s currently possible to use these on top level:

%%%%% \version  "2.19.27"
It's possible to use any music variable at top level.

gives no warning or other message, but the attached (nonsense) output.

This becomes a problem when ")" has been redefined and somewhere else
a Scheme expression has mismatched braces:

%%%%% \version  "2.19.27"
")" =\melismaEnd
#(define test "foo"))

An extremely annoying case to debug, I can tell you.

So redefining ")" should not preclude the warnings which turn up
without the redefinition.
What warnings?  You are talking about an error here:

/tmp/riga.ly:1:1: error: syntax error, unexpected EVENT_IDENTIFIER

That’s what I mean. Such a message immediately points to the culprit, which in my real-life case was an unmatched brace, a common source for problems. Without the message, I had to debug hundreds of lines of code within nested include files and without any kind of indication what to look for.

and that error is based exclusively on the _content_ of ")" and not
related to any independently produced warnings.  For example, you can
write \] and just get
/tmp/riga.ly:1:1: warning: cannot find start of ligature

Making an error based on context-spec-music would be quite strange, by
the way, since _many_ toplevel expressions are context-spec-music, like
\new PianoStaff ...

Of course. The title I gave is nonsense then, I see.
I had been afraid there would be complications, but it would be very good if there were a way to give some kind of message pointing to the stray brace.

Yours, Simon

reply via email to

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