| Re: [frogs] Enhancement request: Define output-suffix as a configurable context property. |
[ Thread Index | Date Index | More lilynet.net/frogs Archives ]
|
Hi Carl, That will work, but it's still a work-around. We'd be avoiding setting it as a context property to keep the architectural thinking clean, while at the same time duplicating the functionality of a property by hand. What we're in effect doing here is duplicating the behaviour of a property, we're hiding the parser variable and writing a function to write to it. So why not pvSet =
#(define-music-function (parser layout parser-variable new-value) (variable? string?)
(set! parser-variable new-value)
(make-music 'SequentialMusic 'void #t))
then do
\book {
\pvset output-suffix "gibbon-vole-aardvark"
{... \score blocks and things ...}
}
But I'm still bothered we may be
re-inventing the wheel here. We've got properties in lily already, and
defined ways of setting them (\set, \override and even assigning them
in the relevant block).Could we not add a new define-parser-variable-properties.scm with (define-public all-pv-properties '()) (define (pv-property-description symbol type? description) (if (not (and (symbol? symbol) (procedure? type?) (string? description))) (throw 'init-format-error)) (if (not (equal? #f (object-property symbol 'translation-doc))) (ly:error (_ "symbol ~S redefined" symbol))) (set-object-property! symbol 'translation-type? type?) (set-object-property! symbol 'translation-doc description) (set! all-pv-properties (cons symbol all-translation-properties)) symbol) (define-public all-pv-properties (map (lambda (x) (apply pv-property-description x)) `( (output-suffix ,string? "Text to append to the output filename for the current @code{\\book} block") ;;; Maybe add all the other supported parser variables here? ))) The above should work as I've adapted it unashamedly from define-context-properties.scm Remaining things to do would be
Opinions? Cheers, Ian Carl Sorensen wrote: On 9/19/09 7:27 AM, "Ian Hulin" <ian@xxxxxxxxxxxx> wrote: |
| Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |