[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Syntax highlightmode for emacs



Hejsa.

Jeg er ved at lave en major-mode til emacs således at mine VDM-SL/VDM++
filer kan blive arbejdet med på en lidt mere behagelig måde.

Pt er jeg kommet frem til følgende:

(define-generic-mode 'VDM-mode
  '("--")
  '("public" "private" "protected" "async" "static" "while" "let" "do"
"in" "if" "then" "return" "for" "all" "else" "end" "opertions"
"functions" "thread" "instance" "variables" "sync" "class" "abs"
"allsuper" "always" "and\\answer" "assumption" "atomic" "be" "bool"
"by" "card" "and" "cases" "char" "comp" "compose" "conc" "cycles"
"dcl" "def" "del" "dinter" "div" "dom" "dunion" "duration" "effect"
"elems\\error" "errs" "exists" "exists1" "exit" "ext" "floor" "\\from"
"general" "hd" "in" "inds" "init\\inmap" "input" "int" "inter" "inv"
"inverse" "iota" "is" "isofbaseclass" "isofclas" "inv" "inverse"
"lambda" "map" "mu" "mutex" "mod" "nat" "nat1" "new" "merge" "munion"
"not" "of" "or" "or" "others" "per" "periodic" "post" "pre" "pref"
"qsync" "rd" "responsibility" "reverse" "samebaseclass" "sameclass"
"psubset" "rem" "rng" "sel" "self" "seq" "seq1" "set" "skip"
"specified" "st" "start" "startlist" "subclass" "subset" "subtrace"
"synonym" "threadid" "time" "tixe" "tl" "to" "token" "trap"
"undefined" "union" "using" "values" "with" "wr" "yet" "RESULT"
"false" "true" "nil" "periodic" "pref" "rat" "real")
  '(("[0-9]+" . 'font-lock-variable-name-face)
    ;("(?" . 'font-lock-variable-name-face)
    ("[A-Za-z]+(" . 'font-lock-function-name-face))
  '("\\.vdm\\'")
  (list (lambda () (setq comment-start "--")))
  "Major mode for VDM-SL/VDM++ highlighting.")


Dvs. jeg nu har highlight på samtlige (tror jeg da) keywords og kommentarer.

Mit næste mål er at få funktioner til at være pæne, det er det jeg har
forsøgt med

    ("[A-Za-z]+(" . 'font-lock-function-name-face))

Det virker også okay, dog syntes jeg personlig der er trælst at i
funktionen "foobar(intput)" så er den første ( også farvet blå, jeg
ville gerne at man på en eller anden måde kunne lade være med at farve
den parentes.
Specielt da der er andre tidspunkter/konstruktioner hvor det kunne gå
og blive ganske trælst rent læsemæssigt.

Håber der re nogle der lige kan forklare hvordan jeg får gjort således
at det sidste elelemt i mit regulære udtryk ikke bliver en del af
farveladen.

MVH: Lasse


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2008-01-01, 17:38 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *