From 36b12bb2ff73aac3822fbefd1b4a72e44229172a Mon Sep 17 00:00:00 2001 From: Heikki Junes Date: Thu, 21 Nov 2002 00:41:21 +0000 Subject: [PATCH] LilyPond-insert-string: new function --- ChangeLog | 5 +++++ lilypond-mode.el | 19 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1905373d57..e9545dc961 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-11-21 Heikki Junes + + * lilypond-mode.el (LilyPond-insert-string): new function, use it + in LilyPond-insert-tag-notes. + 2002-11-20 Han-Wen Nienhuys * lily/beam-engraver.cc (stop_translation_timestep): reset now_stop_ev_ diff --git a/lilypond-mode.el b/lilypond-mode.el index 2bdb32483d..c12fed470f 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -624,14 +624,25 @@ command." (message "Remember to add all other details as well.") (sit-for 5 0 1))) ))) +(defun LilyPond-insert-string (text pre post) + "Insert text to the buffer if non-empty string is given." + (interactive) + (let ((str (read-string text))) + (if (string-equal str "") + nil + (progn (insert pre str post) + t)))) + (define-skeleton LilyPond-insert-tag-notes "LilyPond notes tag." nil ; (if (bolp) nil ?\n) - "\\notes" - (if (y-or-n-p "Set \"\\relative\" attribute? ") - (concat " \\relative " (skeleton-read "Relative: " "" str))) - " { " _ " }") + (progn + (insert "\\notes ") + (if (not (LilyPond-insert-string "Relative: " "\\relative " " ")) + (LilyPond-insert-string "Transpose: " "\\transpose " " ")) + ()) + "{ " _ " }") (define-skeleton LilyPond-insert-tag-score "LilyPond score tag." -- 2.39.5