2017-09-16 13:28 GMT+02:00 David Kastrup <d...@gnu.org>: > Thomas Morley <thomasmorle...@gmail.com> writes: > >> Other 5181-topic: >> In your patch description you wrote about the problem with >> c-\single \dynamicUp \f >> >> Here I can't follow, compiling this with 2.18.2 and current master >> returns no noticeable difference for me, even using >> display(Lily)Music. >> May be I overlooked something. >> Could you explain a bit more verbose? > > From the commit message: > > Issue 5181/2: Allow lone postevents in braced lists > > Reattaching post-events to a preceding music variable or music > function call (or expression) is often desired but was unsupported. > > This commit caters for the support in braced lists. > > The problem with supporting such expressions _everywhere_ is that it > breaks the use of > > The grammar used here is slightly wrong because it uses indicative mode > for an irrealis. It should rather be: > > The problem with supporting such expressions _everywhere_ would be that > it would break the use of ... since then \f would be attached to > \dynamicUp instead of ... > > c-\single \dynamicUp \f > > since then \f is attached to \dynamicUp instead of becoming the second > argument to \single, due to operator precedence. So reattaching lone > post-events is only done with lower precedence in selected constructs. > > This part of the commit message explains why it has not been possible to > support things like > > xxx = c4 > > { \void \displayLilyMusic \xxx \f } > > even while \xxx \f now works. If the grammar precendences in this case > would have combined \xxx \f, they would also combine \dynamicUp \f in > the use case involving \single since \dynamicUp is a bona-fide > (non-post-event) music expression. > > So I just committed with unsuitable grammar for a hypothetical. You > will not be able to see the described problem with anything committed to > the central repository, but there may be a few instances in the reflog > of my personal repository. Basically I wanted to commit an > implementation that happened not to pass the regtests, so I had to scrap > that approach after convincing myself that this could not otherwise be > made to work. > > -- > David Kastrup
Thanks for the explanations. (1) In this thread we mostly discussed what happens for examples like: { -"foo" r4 } especially which sort of warning should be printed. (I'm fine with 5194 and will comment in this way) But let me focus on other parts: (2) If I understand correctly, with this patch things like below are now possible: xxx = c4 { \xxx -- } and foo = #(define-music-function (mus)(ly:music?) (music-map (lambda (m) (if (music-is-of-type? m 'note-event) #{ $m -. #} m)) mus) #{ \new ChordNames { \tweak self-alignment-X #LEFT \mark "This function is a limited demo, don't use it for any other stuff." } $mus #}) \foo \new Staff \relative c' { c d e f g a b c } Which is a big, big goody! (3) In the light of your explanations above I was afraid the following would fail (meaning the displayed expression wouldn't be complete): buzz = #(define-music-function (mus)(ly:music?) (music-map (lambda (m) (if (music-is-of-type? m 'note-event) (begin (display-scheme-music (ly:music-property m 'articulations)) m) m)) mus) #{ \new ChordNames { \tweak self-alignment-X #LEFT \mark "This function is a limited demo, don't use it for any other stuff." } $mus #}) yyy = c4 \buzz \new Staff { \yyy -\single \dynamicUp \f } But as far as I can tell, all works. So I can live with the problem of xxx = c4 { \void \displayLilyMusic \xxx \f } Great stuff!! Cheers, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user