]> git.donarmstrong.com Git - lilypond.git/blobdiff - mudela-mode.el
release: 1.1.26
[lilypond.git] / mudela-mode.el
index 7db23896b18a8989eb6f5465a53228e9b9daab91..6565db77fdb5334e8b363e6b31c34718ec1926fe 100644 (file)
 ;; * handle lexer modes (\header, \melodic, \lyric) etc.
 ;; * indentation
 ;; * notenames?
-;; * fontlock: \melodic \melodic 
+;; * fontlock: \melodic \melodic
+;; 
 
 (defconst mudela-font-lock-keywords
-  (let* ((keywords '(
-                  "accepts" "break" "bar" "cadenza" "clear" "clef" "cm" "consists" "contains"
-                  "duration" "absdynamic" "in" "translator" "type" "lyric" "key"
-                  "melodic" "melodic_request" "meter" "midi" "mm" "multi" "header"
-                  "notenames" "octave" "output" "partial" "paper" "plet" "property" "pt" "shape"
-                  "include"
-                  "score" "script" "skip" "staff" "table" "spandynamic" "symboltables"
-                  "tempo" "texid" "textstyle" "transpose" "version" "grouping"
-                  ))
+  (let* ((keywords '("alternative" "repeat"
+                    "accepts" "accidentals" "break" "bar" "cadenza" 
+                    "clef" "cm" "consists" "contains" "duration" 
+                    "absdynamic" "scmfile" "lyrics"
+                    "in" "translator" "type" "key" "maininput" "notes"
+                    "musical_pitch" "time" "midi" "mm" "header"
+                    "notenames" "octave" "output" "partial" "paper" "plet" "name"
+                    "property" "pt" "shape" "relative" "include" "score"
+                    "scm" "scmfile"
+                    "script" "skip"  "table" "times" "spandynamic" "symboltables"
+                    "tempo" "texid" "textstyle" "transpose" "version" "grouping"
+                    ))
        (kwregex (mapconcat (lambda (x) (concat "\\\\" x))  keywords "\\|")))
 
     (list 
-     (cons (concat ".\\(" kwregex "\\)[^a-zA-Z]") 1)
-     (cons (concat "^\\(" kwregex "\\)[^a-zA-Z]") 1)
-     '(".\\(\\\\[a-zA-Z][a-zA-Z]*\\)" 1 font-lock-variable-name-face)
-     '("^[\t ]*\\([a-zA-Z][_a-zA-Z]*\\) *=" 1 font-lock-variable-name-face)     
+      (concat ".\\(" kwregex "\\)[^a-zA-Z]")
+      (concat "^\\(" kwregex "\\)[^a-zA-Z]")
+      '(".\\(\\\\[a-zA-Z][a-zA-Z]*\\)" 1 font-lock-variable-name-face)
+      '("^[\t ]*\\([a-zA-Z][_a-zA-Z]*\\) *=" 1 font-lock-variable-name-face)     
     ))
   "Additional expressions to highlight in Mudela mode.")
 
@@ -95,8 +99,8 @@
   (mapcar (function
           (lambda (x) (modify-syntax-entry
                        (car x) (cdr x) mu-mode-syntax-table)))
-         '(( ?\( . "()" ) ( ?\) . ")(" )
-           ( ?\[ . "(]" ) ( ?\] . ")[" )
+         '(( ?\( . "." ) ( ?\) . "." )
+           ( ?\[ . "." ) ( ?\] . "." )
            ( ?\{ . "(}" ) ( ?\} . "){" )
            ( ?\< . "(>" )( ?\> . ")>") 
            ( ?\$ . "." ) ( ?\% . "." ) ( ?\& . "." )
            ( ?\_ . "." )       
            ( ?\' . "w")        
            ( ?\" . "\"" )
-           ( ?\% . "<")        
+           ( ?\% . "<")
            ( ?\n . ">")
-           
-           ))) 
 
-(defconst mu-stringlit-re
-   "\"\\([^\"\n\\]\\|\\\\.\\)*\""      ; double-quoted
-  "Regexp matching a Mudela string literal.")
+; FIXME
+;          ( ?%  .  ". 124b" )
+;          ( ?{  .  ". 23" )
+           ))
 
+  )    
 
 (defconst mu-blank-or-comment-re "[ \t]*\\($\\|%\\)"
   "Regexp matching blank or comment lines.")
   (make-local-variable 'paragraph-start)
   (make-local-variable 'require-final-newline)
   (make-local-variable 'comment-start)
-  (setq comment-start "% ")
-  (setq comment-end "")
+  (make-local-variable 'block-comment-start)
+  (make-local-variable 'block-comment-end)  
+
+  (setq comment-end "\n"
+       comment-start          "%"
+       comment-start-skip     "%{? *"
+       block-comment-start     "%{"
+       block-comment-end       "%}"    
+       )
   (make-local-variable 'comment-end)
   (make-local-variable 'comment-start-skip)
   (setf comment-start-skip "%{")
        paragraph-separate     "^[ \t]*$"
        paragraph-start        "^[ \t]*$"
        require-final-newline  t
-       comment-start          "% "
-       comment-start-skip     "% *"
        comment-column         40
        indent-line-function    'indent-relative-maybe
        )
   (use-local-map mu-mode-map)
 
   ;; run the mode hook. mu-mode-hook use is deprecated
-  (if mudela-mode-hook
-      (run-hooks 'mudela-mode-hook)
-    (run-hooks 'mu-mode-hook)))
+  (run-hooks 'mudela-mode-hook)
+)
+
 
 (defun mu-keep-region-active ()
   ;; do whatever is necessary to keep the region active in XEmacs.
 \f
 (defconst mu-version "0.0.1"
   "`mudela-mode' version number.")
-(defconst mu-help-address "hanwen@cs.ruu.nl"
+(defconst mu-help-address "hanwen@cs.uu.nl"
   "Address accepting submission of bug reports.")
 
 (defun mu-version ()