]> git.donarmstrong.com Git - lilypond.git/blobdiff - lilypond-mode.el
* scm/music-functions.scm (glue-mm-rest-texts): automatically
[lilypond.git] / lilypond-mode.el
index 5946def5652ff34eba01f377990a0e8bd47729a0..3e5053befd75c142d1f226ccb09cfd8b92cbc980 100644 (file)
@@ -5,7 +5,7 @@
 ;;;  
 ;;; (c) 1999--2001 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; 
-;;; Changed 2001--2002 Heikki Junes <heikki.junes@hut.fi>
+;;; Changed 2001--2003 Heikki Junes <heikki.junes@hut.fi>
 ;;;    * Add PS-compilation, PS-viewing and MIDI-play (29th Aug 2001)
 ;;;    * Keyboard shortcuts (12th Sep 2001)
 ;;;    * Inserting tags, inspired on sgml-mode (11th Oct 2001)
@@ -26,7 +26,7 @@
 (require 'easymenu)
 (require 'compile)
 
-(defconst LilyPond-version "1.7.9"
+(defconst LilyPond-version "1.7.12"
   "`LilyPond-mode' version number.")
 
 (defconst LilyPond-help-address "bug-lilypond@gnu.org"
@@ -574,8 +574,9 @@ command."
                                                (apply file nil)))
              (jobs nil)
              (job-string "no jobs"))
-         (if (string-equal name "View")
-             (let ((buffer-xdvi (get-buffer-create "*view*")))
+         (if (member name (list "View" "ViewPS"))
+             ;; is USR1 a right signal for viewps?
+             (let ((buffer-xdvi (get-buffer-create (concat "*" name "*"))))
                (if LilyPond-kick-xdvi
                  (let ((process-xdvi (get-buffer-process buffer-xdvi)))
                    (if process-xdvi
@@ -592,6 +593,16 @@ command."
                  (progn
                    (setq command (concat LilyPond-all-midi-command " " (LilyPond-string-all-midi)))
                    (LilyPond-kill-midi))) ; stop and start playing
+             (if (and (member name (list "Midi" "MidiAll")) job-string)
+                 (if (file-newer-than-file-p
+                      (LilyPond-master-file)
+                      (concat (substring (LilyPond-master-file) 0 -3) ".midi"))
+                     (if (y-or-n-p "Midi older than source. Reformat midi?")
+                         (progn
+                           (LilyPond-command-formatmidi)
+                           (while (LilyPond-running)
+                             (message "Starts playing midi once it is built.")
+                             (sit-for 0 100))))))
              (if (member name (list "LilyPond" "TeX" "2Midi" "2PS" "2Dvi" 
                                     "Book" "LaTeX"))
                  (if (setq jobs (LilyPond-running))
@@ -604,7 +615,8 @@ command."
                            (progn
                              (setq job-string "no jobs")
                              (LilyPond-kill-jobs)
-                             (sit-for 0 500 nil)) ; should wait killing
+                             (while (LilyPond-running)
+                               (sit-for 0 100)))
                          (setq job-string nil)))))
 
              (setq LilyPond-command-default name)