First pass at telml-mode
Getty Ritter
9 years ago
1 | ;; telml-mode.el --- a simple major mode for editing TeLML files. | |
2 | ||
3 | ;; Version: 20150904.0000 | |
4 | ;; Author: Getty Ritter | |
5 | ;; Url: http://github.com/aisamanra/telml-mode | |
6 | ||
7 | (setq telml-font-lock | |
8 | '(( "\\<\\(em\\|link\\|ref\\|sidenote\\|strong\\)\\>" | |
9 | . font-lock-variable-name-face ) | |
10 | ( "[^\\\\]\\\\\\([A-Za-z_-]+\\)" | |
11 | 1 font-lock-variable-name-face ) | |
12 | ( "{\\([^}]*[^\\\\]\\)}" 1 font-lock-string-face) | |
13 | ( "[^\\\\]\\(\\\\\\)[A-Za-z_-]+" | |
14 | 1 font-lock-builtin-face ) | |
15 | ( "[^\\\\]\\([{}|]\\)" 1 font-lock-builtin-face ) | |
16 | )) | |
17 | ||
18 | ||
19 | (defvar telml-syntax-table nil "Syntax table for `telml-mode'.") | |
20 | (setq telml-syntax-table | |
21 | (let ((table (make-syntax-table))) | |
22 | table)) | |
23 | ||
24 | (define-derived-mode telml-mode text-mode | |
25 | "TeLML mode is a major mode for editing TeLML files" | |
26 | :syntax-table telml-syntax-table | |
27 | ||
28 | (setq font-lock-defaults '(telml-font-lock)) | |
29 | (setq mode-name "TeLML mode")) | |
30 | ||
31 | (add-to-list 'auto-mode-alist '("\\.telml\\'" . telml-mode)) | |
32 | ||
33 | (provide 'telml-mode) | |
34 | ||
35 | ;;; telml-mode.el ends here |