Am 13.01.2015 um 21:41 schrieb Urs Liska:
Hi Paul,

thanks for that.
Will have to try that out later today, but indeed it looks exactly like what I'm looking for.
I think I can soon give back the results :-)

Now I've checked - it's perfect. Thank you again!

There is no alist? predicate, but it's very easy to define:

#(define (alist? lst)
   (and (list? lst)
          (every pair? lst)))

Best
Urs


Best
Urs

Am 13. Januar 2015 20:45:31 MEZ, schrieb Paul Morris <p...@paulwmorris.com>:

    Urs Liska wrote

        So does anyone have an idea how I can attach an alist to a
        grob so that an engraver can retrieve it? Is it for example
possible to add an arbitrary property to a grob?

    Hi Urs,  I've had good luck creating custom grob properties, which sounds
    like what you're looking for.  Here's how I do it, with some example custom
    properties that I use:

    %% CUSTOM GROB PROPERTIES
    %% I use "cn-" to keep my functions separate from standard
    %% LilyPond functions (like a poor man's namespace).

    % function from "scm/define-grob-properties.scm" (modified)
    #(define (cn-define-grob-property symbol type?)
        (set-object-property! symbol 'backend-type? type?)
        (set-object-property! symbol 'backend-doc "custom grob property")
        symbol)

    #(cn-define-grob-property 'cn-is-clairnote-staff boolean?)

    #(cn-define-grob-property 'cn-vscale-staff number?)


    Once they are defined I can use the custom properties with any grob (e.g.
    StaffSymbol):

    \overrideStaffSymbol.cn  <http://StaffSymbol.cn>-is-clairnote-staff = ##t
    \overrideStaffSymbol.cn  <http://StaffSymbol.cn>-vscale-staff = #1.2


    I suppose for an alist you would just use list? as the type predicate (or
    maybe there's one for alists?).

    Cheers,
    -Paul



    --
    View this message in 
context:http://lilypond.1069038.n5.nabble.com/Attaching-an-alist-to-a-grob-tp170412p170416.html
    Sent from the User mailing list archive atNabble.com  <http://Nabble.com>.

    ------------------------------------------------------------------------

    lilypond-user mailing list
    lilypond-user@gnu.org
    https://lists.gnu.org/mailman/listinfo/lilypond-user



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to