[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Instanciable scheme engraver (issue216066)
From: |
David Kastrup |
Subject: |
Re: Instanciable scheme engraver (issue216066) |
Date: |
Mon, 22 Feb 2010 18:39:35 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) |
address@hidden writes:
> Reviewers: ,
>
> Message:
> Hi,
>
> This is a proof-of-concept for instanciable scheme engravers, with
> private instance slots.
>
> There is at least one issue that I have to solve before this is
> commitable, as this shows the following warning:
>
> Warning : Attempting to remove nonexisting listener.
> Warning : Attempting to remove nonexisting listener.
Not a problem with your code, I guess, since you get the warning with
the old code and the following naively reduced source as well:
\layout {
\context {
\Voice
\consists
#(let ((instance-counter 0))
(set! instance-counter (1+ instance-counter))
(let ((instance-id instance-counter)
(private-note-counter 0))
`((listeners
(note-event
. ,(lambda (engraver event)
(set! private-note-counter (1+ private-note-counter))
(let ((text (ly:engraver-make-grob engraver 'TextScript
event)))
(ly:grob-set-property! text 'text
(format "~a.~a" instance-id
private-note-counter)))))))))
}
}
<<
\relative c'' { c4 d e f }
\\ \relative c' { c4 d e f }
>>
--
David Kastrup