source: ePrescribing/trunk/p/.emacs@ 1267

Last change on this file since 1267 was 518, checked in by George Lilly, 16 years ago

mumps mode for emacs

File size: 2.0 KB
RevLine 
[518]1;; hooks for run before mode run
2(defvar mumps-mode-hook nil)
3
4;; keywords for higlight
5(defconst mumps-font-lock-keywords-main
6(list
7;; Comments
8'(";.*$" 0 font-lock-comment-face t)
9;; Commands
10
11'("\\<\\(T\\(?:R[EO]\\|[CS]\\)\\|t\\(?:r[eo]\\|[cs]\\)\\|[B-OQRSU-Xb-oqrsu-x]\\)\\>"
12.. font-lock-keyword-face)
13
14'("\\<\\(BREAK\\|CLOSE\\|DO\\|ELSE\\|FOR\\|GOTO\\| HALT\\|IF\\|JOB\\|KILL\\|LOCK\\|MERGE\\|NEW\\|OPEN \\|QUIT\\|READ\\|SET\\|T\\(?:COMMIT\\|R\\(?:ESTART \\|OLLBACK\\)\\|START\\)\\|USE\\|VIEW\\|WRITE\\|XE CUTE\\|break\\|close\\|do\\|else\\|for\\|goto\\|ha lt\\|if\\|job\\|kill\\|lock\\|merge\\|new\\|open\\ |quit\\|read\\|set\\|t\\(?:commit\\|r\\(?:estart\\ |ollback\\)\\|start\\)\\|use\\|view\\|\\(?:wri\\|x ecu\\)te\\)\\>"
15.. font-lock-keyword-face)
16;; Functions
17
18'("\\<\\(\\$\\(?:FN\\|NA\\|Q[LS]\\|RE\\|ST\\|TR\\|fn\\|na\\|q[ls]\\|re\\|st\\|tr\\|[AC-GJLN-TVac-gjln-tv]\\)\\)\\>"
19.. font-lock-function-name-face)
20
21'("\\<\\(\\$\\(?:ASCII\\|CHAR\\|DATA\\|EXTRACT\\|F \\(?:IND\\|NUMBER\\)\\|GET\\|JUSTIFY\\|LENGTH\\|N\ \(?:AME\\|EXT\\)\\|ORDER\\|PIECE\\|Q\\(?:LENGTH\\| SUBSCRIPT\\|UERY\\)\\|R\\(?:ANDOM\\|EVERSE\\)\\|S\ \(?:ELECT\\|TACK\\)\\|T\\(?:EXT\\|RANSLATE\\)\\|VI EW\\|ascii\\|char\\|data\\|extract\\|f\\(?:ind\\|n umber\\)\\|get\\|justify\\|length\\|n\\(?:ame\\|ex t\\)\\|order\\|piece\\|q\\(?:length\\|subscript\\| uery\\)\\|r\\(?:andom\\|everse\\)\\|s\\(?:elect\\| tack\\)\\|t\\(?:ext\\|ranslate\\)\\|view\\)\\)\\>"
22.. font-lock-function-name-face)
23;; Program name
24'("^[a-zA-Z0-9()%,]*[ \t]" . font-lock-type-face)))
25
26;; call font-lock syntax agregators (may be we want to higlight something else?)
27(defvar mumps-font-lock-keywords mumps-font-lock-keywords-main
28"Default highlighting expressions for Mumps mode.")
29
30;; initialization
31(defun mumps-mode ()
32(interactive)
33(kill-all-local-variables)
34(set (make-local-variable 'font-lock-defaults)
35'(mumps-font-lock-keywords))
36(setq major-mode 'mumps-mode)
37(setq mode-name "Mumps")
38(run-hooks 'mumps-mode-hook))
39
40(provide 'mumps-mode)
Note: See TracBrowser for help on using the repository browser.