;;; tes-mode.el
;; Copyright (C) 2014-2015 Davin Pearson
;; Emacs Lisp Archive Entry
;; Filename: tes-mode.el
;; Author/Maintainer: Davin Max Pearson <http://davin.50webs.com>
;; Keywords: tes-mode functionality
;; Version: 1.0
;;; Commentary:
;; This file is not part of GNU Emacs.
;;; Limitation of Warranty
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more detail.
;;
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs, see the file COPYING. If not, see:
;;
;; <http://www.gnu.org/licenses/gpl-3.0.txt>.
;;; Install Instructions:
;; See the following URL for the latest info and a tarball:
;;
;; <http://davin.50webs.com/research/2010/mopa2e2.html#tes-mode>
;;
;; Then untar the tarball to a folder pointed to by the Emacs variable
;; load-path and add the following line to your ~/.emacs file.
;;
;; (require 'tes-mode)
;;; Known Bugs:
;; None so far!
;;; Code:
(defvar tes-mode-syntax-table (copy-syntax-table (with-temp-buffer
;;(fundamental-mode)
;;(LaTeX-mode)
(html-mode)
(syntax-table))))
(defun tes-mode ()
(interactive)
(fundamental-mode)
(setq major-mode 'tes-mode)
(setq mode-name "TES")
(when prefs-davins-keybindings-online-p
(local-set-key "\t" 'd-latex--tab-key)
(local-set-key [(return)] 'd-latex--tes-enter)
(local-set-key [(meta control \\)] 'd-latex--meta-control-backslash))
(set-syntax-table tes-mode-syntax-table)
(progn
(modify-syntax-entry ?< "w")
(modify-syntax-entry ?> "w"))
(d-quote
(modify-syntax-entry ?\[ "(]")
(modify-syntax-entry ?\[ ")[")
(modify-syntax-entry ?\{ "(}")
(modify-syntax-entry ?\} "){")
(modify-syntax-entry ?\ "\\")
;;(modify-syntax-entry ?\" "\"")
(modify-syntax-entry ?- "w"))
(d-font-lock-add-end
`(
("\\(\\\\[a-zA-Z0-9]*\\)" 1 'bold nil)
("$[0-9]+" 0 'bold nil)
("$[0-9]+" 0 'bold nil)
("$[@*]" 0 'bold nil)
("\\<[0-9][0-9.]*" 0 d-face-cc-digits nil)
(, (concat "\\\\" "\\\\") 0 fg:lightred t)
(, (concat "\\(\\<m4" "_dnl\\>\\)\\(.*\\)$") (1 'd-face-m4-dnl nil) (2 'font-lock-comment-face nil))
("\\\\color{\\(red\\)}" 1 'fg:lightred nil)
("\\\\color{\\(green\\)}" 1 'fg:lightgreen nil)
("\\\\color{\\(blue\\)}" 1 'fg:lightblue nil)
("\\\\colorbox\\>" 0 'bold nil)
("@node \\(.*$\\)" 1 'font-lock-function-name-face nil)
("@chapter \\(.*$\\)" 1 'font-lock-function-name-face nil)
("@section \\(.*$\\)" 1 'font-lock-function-name-face nil)
("@\\*" 0 'fg:lightred nil)
(,(concat "\\(m4" "_dnl\\)\\(.*$\\)") (1 d-face-m4-dnl nil) (2 font-lock-comment-face nil))
("\\<\\(DESPAT\\)(\\([^()]*\\))"
(1 'bold nil)
(2 'fg:orange nil))
("\\<\\(BFNS.*EFNS\\)\\>" 1 'fg:lightgreen t)
))
)
(defun d-latex--tes-enter ()
(interactive)
(insert "\n"))
(provide 'tes-mode)
| Back |