]> git.donarmstrong.com Git - lilypond.git/commitdiff
heiki pats
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Apr 2002 12:28:22 +0000 (12:28 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 18 Apr 2002 12:28:22 +0000 (12:28 +0000)
ChangeLog
Documentation/topdocs/FAQ.texi
VERSION
lily/ligature-bracket.cc
lilypond-font-lock.el
lilypond-mode.el

index 5c3b9694396b06d6ce434e827ce82215e8d66739..9c05fe3d54713b3da98cfc8bd5742c99ae5a71cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-04-18  Heikki Junes <hjunes@cc.hut.fi>
+
+       * lilypond-mode.el: Toggles font-lock-multiline (Emacs 21.1 or newer).
+
+       * lilypond-font-lock.el: Handles multiline-strings. Fontifies notes 
+       more strictly. Use more clever regular expressions. Commented regexps.
+
 2002-04-16  Heikki Junes <hjunes@cc.hut.fi>
 
        * lilypond-mode.el: "C-c f" does font-lock-fontify-buffer.
index 28d15edd696934e5a103b269358863283a795f96..8c7586f6e12591dc9c4ce6437e998555b4296973 100644 (file)
@@ -27,11 +27,12 @@ FAQs}.  Also, please look in the searchable mailinglist archives:
 
 @itemize @bullet
 @item
-@uref{http://www.mail-archive.com/help-gnu-music@@gnu.org,help-gnu-music}
+@uref{http://www.mail-archive.com/lilypond-user@@gnu.org,lilypond-user}
 @item
-@uref{http://www.mail-archive.com/bug-gnu-music@@gnu.org,bug-gnu-music}
+@uref{http://www.mail-archive.com/bug-lilypond@@gnu.org,bug-lilypond}
 @item
 @uref{http://www.mail-archive.com/gnu-music-discuss@@gnu.org,gnu-music-discuss}
+(this is the archive of the `old' mailing list.) 
 @end itemize
 
 If you are still at loss, send your questions to the @strong{mailing
diff --git a/VERSION b/VERSION
index c6813374c0f6c1fb9703ff9009d29595a65fa354..d7c8256c9cfe5c0ce9b89c1b02ea784fb6bdb82c 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=52
-MY_PATCH_LEVEL=hjj4
+MY_PATCH_LEVEL=hjj5
 
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
index ec1e20c3bd73d74d7b4d7a1cf284ec9a7053847e..03138e7538a702717c378cb7d7ca0f828f442f68 100644 (file)
@@ -146,4 +146,4 @@ Ligature_bracket::brew_molecule (SCM smob)
 
 ADD_INTERFACE(Ligature_bracket, "ligature-bracket-interface",
              "",
-             "width height");
+             "width thickness height");
index 77a508975f54440c22db6433d86020cb56a73db4..fc66140a61f204fb3e83d54e99c8713a2098720e 100644 (file)
@@ -35,7 +35,7 @@
 "alias" "\\(altern\\|rel\\)ative" "apply" "arpeggio" "autochange" "bar" "break"
 "breathe" "breve" "beamintervals" "broken" "blend" "\\(bc\\|end\\)incipit" 
 "ch\\(ar\\)?" "cg" "chord\\(s\\|stest\\|\\(chord\\)?modifiers\\)?"
-"clef[ \t]*\\(F\\|G\\|alto\\|baritone\\|bass\\|\\(mezzo\\)?soprano\\|treble\\|violin\\|tenor\\)?"
+"clef[ \t]*\"?\\(F\\|G\\|alto\\|baritone\\|bass\\|\\(mezzo\\)?soprano\\|treble\\|violin\\|tenor\\)?\"?"
 "clipping" "[cm]m" "coda" "complex" 
 "\\(command\\)?spanrequest" "consists\\(end\\)?"
 "context" "contrabasso" "\\(de\\)?cr" "default" "denies" "different" "dirs"
 ;; font-lock- comment / string / keyword / builtin / function-name / 
 ;;            variable-name / type / constant / warning -face
 
+;; The order below is designed so that proofreading would be possible.
+
+;; Fontify...
+;; ... first identifiers and keywords.
+;; ... then other expressions having '\'-mark in the beginning.
+;; ... the right and the left side of '='-marks.
+;; ... reserved words, e.g., FiguredBass.
+;; ... notes and rests
+;; "on top", 6) ... '<{[]}>'-brackets
+;; "on top", 7) ... ties, slurs and hairpins
+;; "on top", 8) ... (multiline-)scheme; urgh. one should count the slurs
+;; "on top", 9) ... strings
+;; "on top", 10) ... (multiline-)comments
+
+;; One should note 'font-lock-multiline' has been possible since Emacs 21.1.
+;; See, e.g., text in "http://emacs.kldp.org/emacs-21.1/etc/NEWS".
+
+;; ... identifiers (defined above, see iregex)
+      (cons (concat "\\(\\([_^-]?\\(" iregex "\\)\\)+\\)\\($\\|[] \t(~{}>\\\\_()^*-]\\)") '(1 font-lock-function-name-face))
+
+;; ... keywords (defined above, see kwregex)
+      (cons (concat "\\(\\([_^-]?\\(" kwregex "\\)\\)+\\)\\($\\|[] \t(~{}>\\\\_()^*-]\\)") '(1 font-lock-keyword-face))
+
+;; ... keyword-type constructs, e.g., ^\abracadabra
       '("\\([_^-]?\\\\[a-zA-Z][a-zA-Z]*\\)" 1 font-lock-constant-face)
+
+;; ... the left sid e of '=' -mark
       '("\\([_a-zA-Z.0-9-]+\\)[ \t]*=[ \t]*" 1 font-lock-variable-name-face)
-      '("[ \t]*=[ \t]*\\([_a-zA-Z.0-9-]+\\)" 1 font-lock-variable-name-face)
 
+;; ... the right side of '=' -mark
+      '("[ \t]*=[ \t]*\\([_a-zA-Z.0-9-]+\\)" 1 font-lock-variable-name-face)
 
-;; other reserved words
+;; ... reserved words (defined above, see rwregex)
       (cons (concat "\\(" rwregex "\\)") 'font-lock-variable-name-face)
 
-;; highlight note names; separate notes from (other than ')'-type) brackets
-      '("\\([sR]\\(128\\|64\\|32\\|16\\|8\\|4\\|2\\|1\\)?[.]*[ \t]*[*][ \t]*[0-9]+\\)"1 font-lock-type-face)
-      '("[ <\{[~(!)\t\\\|]\\(\\(\\(\\(do\\|re\\|mi\\|fa\\|sol\\|la\\|si\\)\\(bb?\\|dd?\\|ss?\\)?\\)\\|\\([a-hsrR]\\(flat\\(flat\\)?\\|sharp\\(sharp\\)?\\|ff?\\|ss?\\|is\\(siss\\|s\\|is\\)?\\|es\\(sess\\|s\\|es\\)?\\)?\\)\\|\\(as\\(as\\|es\\)?\\)\\|\\(es\\(es\\)?\\)\\|\\(bb\\)\\)[,']*[?!]?\\(128\\|64\\|32\\|16\\|8\\|4\\|2\\|1\\)?[.]*\\)" 1 font-lock-type-face)
-
-;; highlight identifiers
-      (cons (concat "\\([_^-]?\\(" iregex "\\)\\)+\\($\\|[] \t(~{}>\\\\_-()^]\\)") '(0 font-lock-function-name-face t))
+;; ... multiplied rests, e.g., R1 *8
+      '("\\([sR]\\(128\\|6?4\\|3?2\\|16?\\|8\\)?[.]*[ \t]*[*][ \t]*[0-9]+\\)"1 font-lock-type-face)
 
-;; highlight keywords
-      (cons (concat "\\([_^-]?\\(" kwregex "\\)\\)+\\($\\|[] \t(~{}>\\\\_-()^]\\)") '(0 font-lock-keyword-face t))
+;; ... notes and rests, accidentals and duration, e.g., a,?16..
+      '("\\(^\\|[ <\{[~(!)\t\\\|]\\)\\(\\(\\(\\(\\(do\\|re\\|[ms]i\\|[fl]a\\|sol\\)\\(bb?\\|dd?\\|ss?\\)?\\)\\|\\([a-h]\\(flat\\(flat\\)?\\|sharp\\(sharp\\)?\\|ff?\\|ss?\\|is\\(siss\\|s\\|is\\)?\\|es\\(sess\\|s\\|es\\)?\\)?\\)\\|\\(as\\(as\\|es\\)?\\)\\|\\(es\\(es\\)?\\)\\|\\(bb\\)\\)[,']*[?!]?\\|[srR]\\)\\(128\\|6?4\\|3?2\\|16?\\|8\\)?[.]*\\)" 2 font-lock-type-face)
 
-;; highlight bracketing constructs
+;; "on top", ... '{[]}'-brackets
       '("\\([][}{]\\)" 0 font-lock-warning-face t)
-      ;; these regexps allow angle-brackets to be highlighted when and only when they delimit simultaneous music
-      ;; fontify open < but leave crescendos \< alone
-      '("\\([^\\]\\|^\\)\\(<\\)" 2 font-lock-warning-face t)
-      ;; fontify the close-brackets in <a b c--> (tenuto) and <a b c-^> (marcato)
-      '("[_^-]\\s-*[-^]\\s-*\\(>\\)" 1 font-lock-warning-face t) 
-      ;; but leave a b c-> (accent) alone, accounting for whitespace
-      '("\\([^\\t\\n _^-]\\|^\\)\\s-*\\(>\\)" 2 font-lock-warning-face t)
-      ;; ties ~, slurs \( () \), hairpins \<,  \>, end-of-hairpin \!, 
+
+;; "on top", ... '<>'-brackets, not marcato '->'
+      '("\\(\\(-.\\)+\\|[^-^_]\\)\\([[<>]+\\)" 3 font-lock-warning-face t) 
+
+;; "on top", ... ties ~, slurs \( () \), hairpins \<, \>, \! 
       '("\\(\\\\[(<!>)]\\|[(~)]\\)" 0 font-lock-builtin-face t)
 
-;; highlight scheme: handle slurs up to seventh level
+;; "on top", ... (multiline-)scheme: try find slurs up to 7th
       '("[_^-]?#\\(#[ft]\\|-?[0-9.]+\\|\"[^\"]*\"\\|['`]?[a-zA-Z-:]+\\|['`]?([^()]*\\(([^()]*\\(([^()]*\\(([^()]*\\(([^()]*\\(([^()]*\\(([^)]*)[^()]*\\)*)[^()]*\\)*)[^()]*\\)*)[^()]*\\)*)[^()]*\\)*)[^()]*\\)*[^)]*)\\)" 0 font-lock-string-face t)
 
-;; highlight strings: urgh. should hangle strings in strings, i.e., \\\"
-      '("\\([_^-]?\"[^\"]*\"\\)" 0 font-lock-string-face t)
+;; "on top", ... strings
+      '("\\([_^-]?\"\\([^\"\\\\]\\|\\\\.\\|\\\\\n\\)*\"\\)" 0 font-lock-string-face t)
 
-;; highlight (block) comments; urgh. block comments should be updatable
+;; "on top", ... (multiline-)comments
       '("\\(%\\({[^%]*%\\(}\\|\\([^}][^%]*%\\)+}\\)\\|.*\\)\\)" 0 font-lock-comment-face t)
 
       )
     )
-  "Additional expressions to highlight in LilyPond mode.")
+  "Additional expressions to fontify in LilyPond mode.")
 
 ;; define a mode-specific abbrev table for those who use such things
 (defvar LilyPond-mode-abbrev-table nil
index 54efc565dcdcd740cba1b04db791eed7b8180946..5422ed7b358ec9c8decb1a8c4103f721aacb4555 100644 (file)
@@ -656,10 +656,15 @@ LilyPond-xdvi-command\t\tcommand to display dvi files -- bit superfluous"
   (make-local-variable 'font-lock-defaults)
   (setq font-lock-defaults '(LilyPond-font-lock-keywords))
 
-  ; string and comments are fontified explicitly
+  ;; string and comments are fontified explicitly
   (make-local-variable 'font-lock-keywords-only)
   (setq font-lock-keywords-only t)
 
+  ;; Multi-line font-locking needs Emacs 21.1 or newer.
+  ;; For older versions there is hotkey "C-c f".
+  (make-local-variable 'font-lock-multiline) 
+  (setq font-lock-multiline t) 
+
   (make-local-variable 'paragraph-separate)
   (setq paragraph-separate "^[ \t]*$")