;;;
;;; (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)
(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"
(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
(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))
(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)