]> git.donarmstrong.com Git - lilypond.git/commitdiff
LilyPond-insert-string: new function
authorHeikki Junes <heikki.junes@hut.fi>
Thu, 21 Nov 2002 00:41:21 +0000 (00:41 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Thu, 21 Nov 2002 00:41:21 +0000 (00:41 +0000)
ChangeLog
lilypond-mode.el

index 1905373d57069e362f74c0ea0abc70428c74f571..e9545dc9613cf7d57385a4c345a2fee1a14510f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-21  Heikki Junes <hjunes@cc.hut.fi>
+
+       * lilypond-mode.el (LilyPond-insert-string): new function, use it
+       in LilyPond-insert-tag-notes.
+
 2002-11-20  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * lily/beam-engraver.cc (stop_translation_timestep): reset now_stop_ev_
index 2bdb32483d88ccd6fa2f06628a9ac82aef26a96c..c12fed470f8fa31c0ee023da274b077dff8417a2 100644 (file)
@@ -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."