]> git.donarmstrong.com Git - lilypond.git/commitdiff
add words only once to list.
authorHeikki Junes <heikki.junes@hut.fi>
Fri, 1 Aug 2003 09:10:35 +0000 (09:10 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Fri, 1 Aug 2003 09:10:35 +0000 (09:10 +0000)
ChangeLog
lilypond-mode.el

index 581f5c26af9575e998d3aa1c26468107ae4bee42..fad9c41a73eebd1b11e7c4f383b94fba551af115 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-08-01  Heikki Junes <hjunes@cc.hut.fi>
+
+        * lilypond-mode.el: Add each word to regexps only once.
+
 2003-08-01  Mats Bengtsson  <mats.bengtsson@s3.kth.se>
 
        * Documentation/topdocs/INSTALL.texi (Top): Documentation of the
index 57cd5a4f74133e72e4744ed7b5628d57388ab7dc..1b8a14c88b41e6072e14e3c5b8d6c40d4cf78b06 100644 (file)
@@ -89,46 +89,43 @@ Finds file lilypond-words from load-path."
       (kill-buffer b)))
 
 (defconst LilyPond-keywords 
-  (let ((wordlist ())
+  (let ((wordlist '("\\score")) ; add \keywords to lilypond.words
        (co (all-completions "" (LilyPond-add-dictionary-word ()))))
     (progn
       (while (> (length co) 0)
        (if (> (length (car co)) 1)
            (if (and (string-equal "\\" (substring (car co) 0 1))
                     (string-equal (downcase (car co)) (car co)))
-               (add-to-list 'wordlist (car co))))
+               (if (not (member (car co) wordlist))
+                   (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")
 
 (defconst LilyPond-identifiers 
-  (let ((wordlist ())
+  (let ((wordlist '("\\voiceOne")) ; add \Identifiers to lilypond.words
        (co (all-completions "" (LilyPond-add-dictionary-word ()))))
     (progn
       (while (> (length co) 0)
        (if (> (length (car co)) 1)
            (if (and (string-equal "\\" (substring (car co) 0 1))
                     (not (string-equal (downcase (car co)) (car co))))
-               (add-to-list 'wordlist (car co))))
+               (if (not (member (car co) wordlist))
+                   (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")
 
 (defconst LilyPond-reserved-words 
-  (let ((wordlist ())
+  (let ((wordlist '("Staff")) ; add ReservedWords to lilypond.words
        (co (all-completions "" (LilyPond-add-dictionary-word ()))))
     (progn
       (while (> (length co) 0)
        (if (> (length (car co)) 0)
-           (if (not (string-equal "\\" (substring (car co) 0 1)))
-               (add-to-list 'wordlist (car co))))
+           (if (not (string-match "[^a-zA-Z]" (car co)))
+               (if (not (member (car co) wordlist))
+                   (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")