-
Notifications
You must be signed in to change notification settings - Fork 0
/
_emacs_mode
40 lines (32 loc) · 1.45 KB
/
_emacs_mode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;
;
;
; - emacs OPIUM mode - v3.0
; used to highlight keyblocks mispelled keyblocks red
; and correctly spelled keyblock purple.
;
; To use, append this file to your ~/.emacs file
(defvar opium-mode-hook nil)
(defvar opium-mode-map
(let ((opium-mode-map (make-keymap)))
(define-key opium-mode-map "\C-j" 'newline-and-indent)
opium-mode-map)
"Keymap for OPIUM major mode")
(add-to-list 'auto-mode-alist '("\\.param\\'" . opium-mode))
(defconst opium-font-lock-keywords-1
(list
'("\\[\\(atom\\|Atom\\|ATOM\\|pseudo\\|Pseudo\\|PSEUDO\\|optinfo\\|Optinfo\\|OPTINFO\\|xc\\|Xc\\|XC\\|pcc\\|Pcc\\|PCC\\|relativity\\|Relativity\\|RELATIVITY\\|grid\\|Grid\\|GRID\\|relgrid\\|Relgrid\\|RELGRID\\|tol\\|Tol\\|TOL\\|configs\\|Configs\\|CONFIGS\\|kbdesign\\|KBdesign\\|Kbdesign\\|KBDESIGN\\|hfsmooth\\Hfsmooth\\|HFsmooth\\|HFSMOOTH\\|loginfo\\|Loginfo\\|LOGINFO|average\\|Average\\|AVERAGE \\)\\]" . font-lock-keyword-face)
'("\\(\\[\\w*\\]\\)" . font-lock-warning-face))
"Minimal highlighting expressions for OPIUM mode")
(defvar opium-font-lock-keywords opium-font-lock-keywords-1
"Default highlighting expressions for OPIUM mode")
(defun opium-mode ()
"Major mode for editing opium param files"
(interactive)
(kill-all-local-variables)
(use-local-map opium-mode-map)
(set (make-local-variable 'font-lock-defaults) '(opium-font-lock-keywords))
(setq major-mode 'opium-mode)
(setq mode-name "OPIUM")
(run-hooks 'opium-mode-hook))
(provide 'opium-mode)