;;;
;;; (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"
(setq fn (concat (car lp) "/" words-file))
(if (not (file-readable-p fn))
(progn (setq fn nil) (setq lp (cdr lp)))))
+ (if (not fn)
+ (progn (message "Error (shown for 12 seconds; press a key to skip):\n\n File `lilypond.words' containing keywords to be autocompleted and fontified,\n was not found. Place it to your `load-path' (see `lilypond-init.el').\n")
+ (sit-for 12 0 1)))
fn))
(defun LilyPond-add-dictionary-word (x)
- "Contains all words: keywords, identifiers, reserved words."
+ "Contains all words: \keywords \Identifiers and ReservedWords."
(nconc '(("" . 1)) x))
;; creates dictionary if empty
-(if (eq (length (LilyPond-add-dictionary-word ())) 1)
+(if (and (eq (length (LilyPond-add-dictionary-word ())) 1)
+ (not (eq (LilyPond-words-filename) nil)))
(progn
- (setq fn (LilyPond-words-filename))
- (setq b (find-file-noselect fn t t))
+ (setq b (find-file-noselect (LilyPond-words-filename) t t))
(setq m (set-marker (make-marker) 1 (get-buffer b)))
(setq i 1)
(while (> (buffer-size b) (marker-position m))
(string-equal (downcase (car co)) (car co)))
(add-to-list 'wordlist (car co))))
(setq co (cdr co)))
+ (if (eq (length wordlist) 0)
+ (setq wordlist '("\\score"))) ; add \keywords to lilypond.words
wordlist))
"LilyPond \\keywords")
(not (string-equal (downcase (car co)) (car co))))
(add-to-list 'wordlist (car co))))
(setq co (cdr co)))
+ (if (eq (length wordlist) 0)
+ (setq wordlist '("\\voiceOne"))) ; add \Identifiers to lilypond.words
wordlist))
"LilyPond \\Identifiers")
(if (not (string-equal "\\" (substring (car co) 0 1)))
(add-to-list 'wordlist (car co))))
(setq co (cdr co)))
+ (if (eq (length wordlist) 0)
+ (setq wordlist '("Staff"))) ; add ReservedWords to lilypond.words
wordlist))
"LilyPond ReservedWords")
(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
(LilyPond-shell-process name buffer-xdvi command)))
(LilyPond-shell-process name buffer-xdvi command)))
(progn
- (if (member name (list "Midi" "MidiAll"))
- (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 (string-equal name "Midi")
(progn
(setq command (concat LilyPond-midi-command " " (LilyPond-string-current-midi)))
(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))