lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Emacs-mode: Highlight block comments


From: Heikki Johannes Junes
Subject: [PATCH] Emacs-mode: Highlight block comments
Date: Sat, 13 Apr 2002 13:58:35 +0300 (EET DST)

Is the following idea correct ?
- Block comments can have also ordinary comments inside.

For me it seems reasonable.

Index: VERSION
===================================================================
RCS file: /home/lilypond/lilypond/VERSION,v
retrieving revision 1.381
diff -p -u -r1.381 VERSION
--- VERSION     12 Apr 2002 17:43:32 -0000      1.381
+++ VERSION     13 Apr 2002 10:51:10 -0000
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=52
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hjj1
 
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
Index: ChangeLog
===================================================================
RCS file: /home/lilypond/lilypond/ChangeLog,v
retrieving revision 1.75
diff -p -u -r1.75 ChangeLog
--- ChangeLog   12 Apr 2002 17:43:32 -0000      1.75
+++ ChangeLog   13 Apr 2002 10:51:23 -0000
@@ -1,3 +1,10 @@
+2002-04-13  Heikki Junes <address@hidden>
+
+       * lilypond-mode.el: Prevent recoloring strings and comments.
+
+       * lilypond-font-lock.el: Handle block comments: block comments
+       can have also ordinary comments inside.
+       
 2002-04-12  Han-Wen Nienhuys  <address@hidden>
 
        * lily/*.cc: add some undocced properties.
Index: lilypond-mode.el
===================================================================
RCS file: /home/lilypond/lilypond/lilypond-mode.el,v
retrieving revision 1.32
diff -p -u -r1.32 lilypond-mode.el
--- lilypond-mode.el    9 Apr 2002 23:21:21 -0000       1.32
+++ lilypond-mode.el    13 Apr 2002 10:51:32 -0000
@@ -25,7 +25,7 @@
 (require 'easymenu)
 (require 'compile)
 
-(defconst LilyPond-version "1.5.51"
+(defconst LilyPond-version "1.5.52"
   "`LilyPond-mode' version number.")
 
 (defconst LilyPond-help-address "address@hidden"
@@ -653,6 +653,10 @@ LilyPond-xdvi-command\t\tcommand to disp
 
   (make-local-variable 'font-lock-defaults)
   (setq font-lock-defaults '(LilyPond-font-lock-keywords))
+
+  ; string and comments are fontified explicitly
+  (make-local-variable 'font-lock-keywords-only)
+  (setq font-lock-keywords-only t)
 
   (make-local-variable 'paragraph-separate)
   (setq paragraph-separate "^[ \t]*$")
Index: lilypond-font-lock.el
===================================================================
RCS file: /home/lilypond/lilypond/lilypond-font-lock.el,v
retrieving revision 1.13
diff -p -u -r1.13 lilypond-font-lock.el
--- lilypond-font-lock.el       12 Apr 2002 09:45:38 -0000      1.13
+++ lilypond-font-lock.el       13 Apr 2002 10:51:38 -0000
@@ -9,8 +9,8 @@
 ;; Author: 1995-1996 Barry A. Warsaw
 ;;         1992-1994 Tim Peters
 ;; Created:       Feb 1992
-;; Version:       1.5.51
-;; Last Modified: 12APR2002
+;; Version:       1.5.52
+;; Last Modified: 13APR2002
 ;; Keywords: lilypond languages music notation
 
 ;; This software is provided as-is, without express or implied
@@ -150,11 +150,11 @@
 ;; highlight scheme; Urgh. should count '(':s, then continue up to last ')'
       
'("[_^-]?#\\(#[ft]\\|['`](lines[^)]*))\\|['`][a-zA-Z-:]+\\|['`]?([^)]*)\\|-?[0-9.]+\\|\"[^\"]*\"\\)"
 0 font-lock-string-face t)
 
-;; (re)highlight strings
+;; highlight strings
       '("[_^-]?\"[^\"]*\"" 0 font-lock-string-face t)
 
-;; (re)highlight comments
-      '("\\(%.*\\)" 0 font-lock-comment-face t)
+;; highlight (block) comments; urgh. block comments should be updatable
+      '("\\(%\\({[^%]*%\\(}\\|\\([^}][^%]*%\\)+}\\)\\|.*\\)\\)" 0 
font-lock-comment-face t)
 
       )
     )
--
      Heikki Junes




reply via email to

[Prev in Thread] Current Thread [Next in Thread]