1;;;;ReplaceChord
2(let ((tag "ReplaceChord")
3  (lily #f))
4  (set! lily (d-DirectiveGet-chord-prefix tag))
5  (if  lily
6    (begin
7      (if (> (string-length lily) 2)
8	(set! lily (string-drop-right lily 2))))
9    (set! lily "r"))
10  (set! lily (d-GetUserInput "Replace Note/Rest" "Give LilyPond syntax to replace the note or rest at the cursor or blank to delete" lily))
11  (if (and lily (> (string-length lily) 0))
12    (begin
13      (d-DirectivePut-chord-prefix tag (string-append lily "%{"))
14      (d-DirectivePut-chord-postfix tag " %}\n")
15      (d-DirectivePut-chord-override tag  DENEMO_OVERRIDE_AFFIX)
16      (d-DirectivePut-chord-display tag "customized"))
17    (d-DirectiveDelete-chord tag)))
18(d-SetSaved #f)