[Top][All Lists]

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

Re: is (context-has-engraver? ctx sym) possible?

From: Neil Puttock
Subject: Re: is (context-has-engraver? ctx sym) possible?
Date: Wed, 5 Aug 2009 22:09:23 +0100

2009/8/5 Mark Polesky <address@hidden>:

> Is it possible to write a scheme procedure to test if a given
> context contains a particular engraver? Like...
> (context-has-engraver? context 'Span_arpeggio_engraver)

>From engraver-doc-string:

     (if in-which-contexts
         (let* ((layout-alist (ly:output-description $defaultlayout))
                (context-description-alist (map cdr layout-alist))
                 (apply append
                         (lambda (x)
                           (let* ((context (cdr (assoc 'context-name x)))
                                  (group (assq-ref x 'group-type))
                                  (consists (append
                                             (if group
                                                 (list group)
                                             (cdr (assoc 'consists x)))))
                             (if (member name-sym consists)
                                 (list context)

Unfortunately, this doesn't seem particularly useful, since you need
access to the correct output-def: $defaultlayout won't pick up a
Span_arpeggio_engraver in the Staff context if it's been added using


reply via email to

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