[interchange] Add emacs major mode for ITL

Jon Jensen <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit 349a71055d7ec54193d161d997f0db83c0423811
Author: Jon Jensen <[email protected]>
Date:   Mon Jul 15 07:23:00 2013 +0100

    Add emacs major mode for ITL

 eg/emacs/itl.el |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/eg/emacs/itl.el b/eg/emacs/itl.el
new file mode 100644
index 0000000..5d84d8c
--- /dev/null
+++ b/eg/emacs/itl.el
@@ -0,0 +1,49 @@
+;;; itl.el -- Major mode for editing Interchange Tag Language files
+
+;; Author: Steve Shoopak <[email protected]>
+;; Created: October 20th, 2005
+;; Keywords: ITL major-mode
+
+;;; Description:
+;;
+;; This mode allows syntax highlighting of files with
+;; embedded Interchange Tag Language.
+
+;;; Code:
+(defvar itl-mode-hook nil)
+(defvar itl-mode-map nil)
+
+(add-to-list 'auto-mode-alist '("\\.itl\\'" . itl-mode))
+
+(defconst itl-font-lock-keywords-1
+  (list
+    '("\\[\\\/?\\w+" . font-lock-keyword-face)
+    '("\\(\\[\\|\\]\\)" . font-lock-keyword-face)
+    '("\\(\\(__\\|\\@_\\|\\@\\@\\)\\w*\\(__\\|_\\@\\|\\@\\@\\)\\)" .
+font-lock-variable-name-face))
+  "Basic stuff to highlight in ITL mode")
+
+(defvar itl-font-lock-keywords itl-font-lock-keywords-1
+  "ITL mode keywords.  You might append more to extend the basic list.")
+
+(defvar itl-mode-syntax-table
+  (let ((itl-mode-syntax-table (make-syntax-table)))
+    (modify-syntax-entry ?_ "w" itl-mode-syntax-table)
+    (modify-syntax-entry ?/ ". 124b" itl-mode-syntax-table)
+    (modify-syntax-entry ?* ". 23" itl-mode-syntax-table)
+    (modify-syntax-entry ?\n "> b" itl-mode-syntax-table)
+    itl-mode-syntax-table)
+  "Syntax table for itl-mode")
+
+(defun itl-mode ()
+  "Major mode for editing Interchange Tag Language files"
+  (interactive)
+  (kill-all-local-variables)
+  (set-syntax-table itl-mode-syntax-table)
+  (use-local-map itl-mode-map)
+  (set (make-local-variable 'font-lock-defaults) '(itl-font-lock-keywords))
+  (setq major-mode 'itl-mode)
+  (setq mode-name "ITL")
+  (run-hooks 'itl-mode-hook))
+
+(provide 'itl-mode)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.