From 4aa251f29f1ad42b9f79abca67a89ba2bf266ec7 Mon Sep 17 00:00:00 2001 From: Heikki Junes Date: Fri, 6 Dec 2002 23:38:06 +0000 Subject: [PATCH] Accept only [a-zA-Z] for user defined identifiers. --- ChangeLog | 4 +++- lilypond-font-lock.el | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9832fb94c..bee0fd1b70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ 2002-12-06 Heikki Junes * lilypond.vim: - * lilypond-font-lock.el: Put \longa as duration. + * lilypond-font-lock.el: Put \longa as duration. Accept only + [a-zA-Z] for user defined identifiers. Separate note cases + with and without a duration (allow cis\longaX). * lilypond.words: Add words from Info. diff --git a/lilypond-font-lock.el b/lilypond-font-lock.el index f9bb4f2ef6..6970c8f9c4 100644 --- a/lilypond-font-lock.el +++ b/lilypond-font-lock.el @@ -61,8 +61,8 @@ ;; ... keywords (defined above, see kwregex) (cons (concat "\\(\\([_^-]?\\(" kwregex "\\)\\)+\\)\\($\\|[] \t(~{}>\\\\_()^*-]\\)") '(1 font-lock-keyword-face)) -;; ... keyword-type constructs, e.g., ^\abracadabra; not \breve (= a duration) - '("\\([_^-]?\\\\\\(longa[a-zA-Z]\\|long[^a]\\|lon[^g]\\|lo[^n]\\|l[^o]\\|[^lb]\\|b[^r]\\|br[^e]\\|bre[^v]\\|brev[^e]\\|breve[a-zA-Z]\\)[a-zA-Z]*\\)" 1 font-lock-constant-face) +;; ... user defined identifiers \[a-zA-Z]+, but not \breve or \longa (durations) + '("\\([_^-]?\\\\\\([ac-km-zA-Z]\\|l[a-np-zA-Z]\\|b[a-qs-zA-Z]\\|lo[a-mo-zA-Z]\\|br[a-df-zA-Z]\\|lon[a-fh-zA-Z]\\|bre[a-uw-zA-Z]\\|long[b-zA-Z]\\|brev[a-df-zA-Z]\\|\\(longa\\|breve\\)[a-zA-Z]\\)[a-zA-Z]*\\)" 1 font-lock-constant-face) ;; ... the left side of '=' -mark '("\\([_a-zA-Z.0-9-]+\\)[ \t]*=[ \t]*" 1 font-lock-variable-name-face) @@ -73,8 +73,10 @@ ;; ... reserved words (defined above, see rwregex) (cons (concat "\\(" rwregex "\\)") 'font-lock-variable-name-face) -;; ... notes and rests, accidentals and duration (multiplied), e.g., b,?16.*3/4 - '("\\(^\\|[ <\{[~(!)\t\\\|]\\)\\(\\(\\(\\(bb\\|as[ae]s\\|eses\\|\\(do\\|re\\|[ms]i\\|[fl]a\\|sol\\)\\(bb?\\|dd?\\|ss?\\)?\\)\\|\\([a-h]\\(\\(flat\\)+\\|\\(sharp\\)+\\|is\\(siss\\|i?s\\)?\\|es\\(sess\\|e?s\\)?\\|ff?\\|ss?\\)?\\)\\)[,']*[?!]?\\|[srR]\\)\\([ \t]*\\(128\\|6?4\\|3?2\\|16?\\|8\\|\\\\breve\\|\\\\longa\\)[.]*\\([ \t]*[*][ \t]*[0-9]+\\(/[1-9][0-9]*\\)?\\)?\\)?\\)" 2 font-lock-type-face) +;; ... note or rest with (an accidental and) a duration (multiplied), e.g., b,?16.*3/4 + '("\\(^\\|[ <\{[~(!)\t\\\|]\\)\\(\\(\\(\\(bb\\|as[ae]s\\|eses\\|\\(do\\|re\\|[ms]i\\|[fl]a\\|sol\\)\\(bb?\\|dd?\\|ss?\\)?\\)\\|\\([a-h]\\(\\(flat\\)+\\|\\(sharp\\)+\\|is\\(siss\\|i?s\\)?\\|es\\(sess\\|e?s\\)?\\|ff?\\|ss?\\)?\\)\\)[,']*[?!]?\\|[srR]\\)\\([ \t]*\\(128\\|6?4\\|3?2\\|16?\\|8\\|\\\\\\(breve\\|longa\\)\\)[.]*\\([ \t]*[*][ \t]*[0-9]+\\(/[1-9][0-9]*\\)?\\)?\\)\\)" 2 font-lock-type-face) +;; ... note or rest (with an accidental), e.g., b,? -- allows cis\longaX + '("\\(^\\|[ <\{[~(!)\t\\\|]\\)\\(\\(\\(bb\\|as[ae]s\\|eses\\|\\(do\\|re\\|[ms]i\\|[fl]a\\|sol\\)\\(bb?\\|dd?\\|ss?\\)?\\)\\|\\([a-h]\\(\\(flat\\)+\\|\\(sharp\\)+\\|is\\(siss\\|i?s\\)?\\|es\\(sess\\|e?s\\)?\\|ff?\\|ss?\\)?\\)\\)[,']*[?!]?\\|[srR]\\)" 2 font-lock-type-face) ;; "on top", ... '{[]}'-brackets '("\\([][}{]\\)" 0 font-lock-warning-face t) -- 2.39.5