<?xml version="1.0"?>
<Denemo>
  <merge>
    <title>A Denemo Keymap</title>
    <author>AT, JRR, RTS</author>
    <map>
      <row>
        <after>InsertStandaloneDirective</after>
        <action>InsertDefinedLilyPond</action>
        <scheme>;;;InsertDefinedLilyPond
(let ((directives '()) (definitions #f) (choice #f))
	(define (get-second-line text)
		(let ((thelist (string-split text #\newline)))
			(if (&gt; (length thelist) 1)
				(list-ref thelist 1)
				"")))
	(define (extract-menuitem tag)
		(define name (get-second-line tag))
		(cons name (lambda () (d-DirectivePut-standalone name) (d-DirectivePut-standalone-postfix name (string-append "\\" name " ")) (d-DirectivePut-standalone-display
		name name)(d-DirectivePut-standalone-minpixels name 30))))
		
	(let loop ((count 1))
			(define good-tag (d-Directive-score? (string-append "Allow\n" (number-&gt;string count))))
			(if good-tag
				(begin
					(set! directives (cons good-tag directives))
					(loop (1+ count)))))
	(if (not (null? directives))
		(set! definitions (map extract-menuitem directives)))
	(if definitions
		(set! choice (d-PopupMenu definitions))
		(d-WarningDialog (_ "No Definitions have been created for this score")))
	(if choice
		(begin	
			(choice)
			(d-RefreshDisplay)
			(d-SetSaved #f))))</scheme>
        <label>Menu of Objects to Insert</label>
        <tooltip>Gives a menu of previously created LilyPondDefinition commands (see Score-&gt;LilyPond Definition  menu for this)</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
