Last active
November 27, 2016 23:56
-
-
Save kazeto/07646f56abf4a954068e66cc717a5f01 to your computer and use it in GitHub Desktop.
A Emacs major mode for Tuffy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; -------- Tuffy mode -------- | |
(define-derived-mode | |
tuffy-mode text-mode | |
"Tuffy" "View mode for Tuffy's input file." | |
(setq tuffy-font-lock-keywords | |
'(("//.*$" . font-lock-comment-face) | |
("!" . font-lock-warning-face) | |
("\\(\"[^\"]*\"\\)\\s-*," 1 font-lock-string-face) | |
("\\(\"[^\"]*\"\\)\\s-*)" 1 font-lock-string-face) | |
(" v " . font-lock-constant-face) | |
(" ^ " . font-lock-constant-face) | |
(" => " . font-lock-constant-face) | |
("\\*" . font-lock-constant-face) | |
(")\\(\\s-*,\\)" 1 font-lock-constant-face) | |
("^[0-9.]+\\s-" . font-lock-variable-name-face) | |
("[.]$" . font-lock-variable-name-face))) | |
(setq font-lock-defaults | |
'(tuffy-font-lock-keywords t t nil nil)) | |
(add-hook 'tuffy-mode-hook 'turn-on-font-lock)) | |
(add-to-list 'auto-mode-alist '("\\.mln$" . tuffy-mode)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment