]> git.donarmstrong.com Git - lilypond.git/commitdiff
sensible error if lilypond.words not found
authorHeikki Junes <heikki.junes@hut.fi>
Fri, 11 Apr 2003 22:54:05 +0000 (22:54 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Fri, 11 Apr 2003 22:54:05 +0000 (22:54 +0000)
ChangeLog
lilypond-mode.el
lilypond.words

index 36a41a9517b307c016d934b53c1bd41d302bee33..7e5cc517fe91e9ae69520d84e5535a3322c9d14b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-12  Heikki Junes <hjunes@cc.hut.fi>
+
+       * lilypond-mode.el: sensible error if lilypond.words not found.
+
+       * lilypond.words: add few words.
+
 2003-04-11  Juergen Reuter  <reuter@ipd.uka.de>
 
        * mf/parmesan-clefs.mf: bugfix: char boxes corrected
index 7df2546a5a68b1b29414e071a25d8d1b67d02076..814e359e317100f92e4bcc6f4e482a8231a035d5 100644 (file)
@@ -20,7 +20,6 @@
 ;;; for installing instructions.
 
 ;;; TODO:
-;;;    * sensible error if lilypond.words not found. 
 ;;;    * XEmacs, broken ?
 ;;;    * parenthesis matching
 
@@ -66,17 +65,20 @@ Finds file lilypond-words from load-path."
       (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))
@@ -96,6 +98,8 @@ Finds file lilypond-words from load-path."
                     (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")
 
@@ -109,6 +113,8 @@ Finds file lilypond-words from load-path."
                     (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")
 
@@ -121,6 +127,8 @@ Finds file lilypond-words from load-path."
            (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")
 
index 99aed847e787e7542b874c4f78cda2f442a427a8..5f23d0669a93c4f68c7001f8e0ed64d8cc089afd 100644 (file)
@@ -167,6 +167,7 @@ Ligature_bracket_engraver
 \\linebreak
 \\lineprall
 \\locrian
+\\longfermata
 \\lower
 \\lowerOctave
 \\lowerOne
@@ -334,6 +335,7 @@ Score
 \\shiftV
 \\shortlong
 \\showStaffSwitch
+\\signumcongruentiae
 \\simultaneous
 \\singlepart
 \\skip
@@ -456,8 +458,10 @@ unfold
 \\upperOctave
 \\upperOne
 \\upperVoice
+\\varcoda
 \\version
 VerticalAlignment
+\\verylongfermata
 violin
 \\visible
 Voice