From 15f970becac9ad8d8c16302a597519360c38ee6b Mon Sep 17 00:00:00 2001 From: Heikki Junes Date: Fri, 1 Aug 2003 09:10:35 +0000 Subject: [PATCH] add words only once to list. --- ChangeLog | 4 ++++ lilypond-mode.el | 23 ++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 581f5c26af..fad9c41a73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-08-01 Heikki Junes + + * lilypond-mode.el: Add each word to regexps only once. + 2003-08-01 Mats Bengtsson * Documentation/topdocs/INSTALL.texi (Top): Documentation of the diff --git a/lilypond-mode.el b/lilypond-mode.el index 57cd5a4f74..1b8a14c88b 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -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") -- 2.39.5