Werner LEMBERG wrote: > > Instead of documenting this in the IR, maybe it would be better to > > write a section in the CG about how to find a grob's parent, the > > parent's parent, etc. with GDB? > > Hmm. Any chance to have this in Scheme?
Werner, Here's one way of doing it (from within a music block). - Mark _________________ \version "2.13.2" #(define (grob-name grob) (if (ly:grob? grob) (assoc-ref (ly:grob-property grob 'meta) 'name) #f)) #(define (get-ancestry grob) (if (not (null? (ly:grob-parent grob X))) (list (grob-name grob) (get-ancestry (ly:grob-parent grob X)) (get-ancestry (ly:grob-parent grob Y))) (grob-name grob))) #(define (format-ancestry lst generation) (string-append (symbol->string (car lst)) "\n" (make-string (* generation 3) #\space) "X: " (if (list? (cadr lst)) (format-ancestry (cadr lst) (1+ generation)) (symbol->string (cadr lst))) "\n" (make-string (* generation 3) #\space) "Y: " (if (list? (caddr lst)) (format-ancestry (caddr lst) (1+ generation)) (symbol->string (caddr lst))) "\n")) #(define (display-ancestry grob) (display (string-append (make-string 36 #\-) "\n" (format-ancestry (get-ancestry grob) 0)))) \relative { \once \override NoteHead #'before-line-breaking = #display-ancestry f %\once \override Accidental #'before-line-breaking = #display-ancestry %\once \override Arpeggio #'before-line-breaking = #display-ancestry <f as c>\arpeggio } _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel