1;;;InsertStandaloneDirective
2(let ((replace #f)(choice 'new)(current (d-DirectiveGet-standalone-postfix (d-DirectiveGetTag-standalone))))
3    (if current
4      (begin
5        (set! choice (RadioBoxMenu
6                     (cons (_ "New LilyPond Directive")   'new)
7                     (cons (string-append (_ "Edit ") current) 'edit)
8                     (cons (_ "Advanced") 'advanced)))
9        (case choice
10            ((advanced)
11                (d-DirectiveTextEdit-standalone (d-DirectiveGetTag-standalone))
12                (set! choice #f))
13            ((edit) (set! replace current)))))
14     (if choice
15        (let ((answer (d-GetUserInput "Insert Lilypond" "Give Lilypond text to insert" (if current current ""))))
16            (if (and answer (not (string=? answer "")))
17                (begin
18                    (if replace
19                        (d-DirectivePut-standalone-postfix (d-DirectiveGetTag-standalone) (string-append answer " "))
20                        (StandAloneDirectiveProto (cons (d-GetChecksum answer) (string-append answer " ")))))))))
21