]> git.donarmstrong.com Git - lilypond.git/commitdiff
Scheme function to return a grob's name
authorDavid Nalesnik <david.nalesnik@gmail.com>
Sun, 15 Feb 2015 19:47:46 +0000 (13:47 -0600)
committerDavid Nalesnik <david.nalesnik@gmail.com>
Wed, 25 Feb 2015 17:04:10 +0000 (11:04 -0600)
Users of Scheme would benefit from a convenient way to access a
grob's name.  This patch creates the function grob::name, which
takes a grob as argument and returns its name as a symbol.

scm/output-lib.scm

index fdcea5de6488fed13954634e79442d21f3f0234c..7f956a54d574549efbf360575efc782ad817fb67 100644 (file)
 (define-public (grob::is-live? grob)
   (pair? (ly:grob-basic-properties grob)))
 
+(define-public (grob::name grob)
+  "Return the name of the grob @var{grob} as a symbol."
+  (assq-ref (ly:grob-property grob 'meta) 'name))
+
 (define-public (make-stencil-boxer thickness padding callback)
   "Return function that adds a box around the grob passed as argument."
   (lambda (grob)