;; telml-mode.el --- a simple major mode for editing TeLML files.

;; Version: 20150904.0000
;; Author: Getty Ritter
;; Url: http://github.com/aisamanra/telml-mode

(setq telml-font-lock
      '(( "\\<\\(em\\|link\\|ref\\|sidenote\\|strong\\)\\>"
          . font-lock-variable-name-face )
        ( "[^\\\\]\\\\\\([A-Za-z_-]+\\)"
          1 font-lock-variable-name-face )
        ( "{\\([^}]*[^\\\\]\\)}" 1 font-lock-string-face)
        ( "[^\\\\]\\(\\\\\\)[A-Za-z_-]+"
          1 font-lock-builtin-face )
        ( "[^\\\\]\\([{}|]\\)" 1 font-lock-builtin-face )
        ))


(defvar telml-syntax-table nil "Syntax table for `telml-mode'.")
(setq telml-syntax-table
      (let ((table (make-syntax-table)))
        table))

(define-derived-mode telml-mode text-mode
  "TeLML mode is a major mode for editing TeLML files"
  :syntax-table telml-syntax-table

  (setq font-lock-defaults '(telml-font-lock))
  (setq mode-name "TeLML mode"))

(add-to-list 'auto-mode-alist '("\\.telml\\'" . telml-mode))

(provide 'telml-mode)

;;; telml-mode.el ends here
