;; Major mode for editing Else definition files. ;; ;; Copyright (C) 1999, 2000, 2001 Stephen Leake ;; ;; Author : Stephen Leake ;; Web Site : http://users.erols.com/leakstan/Stephe/index.html ;; ;; Keywords: else, lse ;; ;; template-mode requires GNU Emacs 20.3.1 or newer. ;; ;; This file is NOT part of GNU Emacs (yet), but is distributed under ;; the GNU General Public License as published by the Free Software ;; Foundation; either version 2, or (at your option) any later ;; version. ;; This code 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 details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; USAGE ;;; ===== ;;; ;;; The main starting point is template-mode; it should be added to ;;; auto-mode-alist for file type .lse. ;;; ;;; DESIGN ;;; ====== ;;; ;;; else uses the mode-name to get the language. Since Peter Milliken ;;; chose "TEMPLATE" as the name of the language, that's what we use ;;; for the mode name (this is case sensitive, since assoc is used to ;;; compare language names). He also uses ".lse" as the file ;;; extension, so we associate .lse files with template-mode. (defconst template-mode-version "0.6") ;;;-------------------- ;;; USER OPTIONS ;;;-------------------- (defgroup template nil "Major mode for editing Else definition files." :group 'languages) (defcustom template-mode-hook nil "*List of functions to call when lse mode is invoked." :type 'hook :group 'lse) (defvar template-mode-map (let ((map (make-sparse-keymap))) (define-key map [next] 'scroll-up) (define-key map [prior] 'scroll-down) map) "Local keymap for lse mode.") ;;; ---- end of user configurable variables ;; main entry point ;;;###autoload (defun template-mode () "lse mode is a major mode for editing Else definition files. Keybindings: \\{template-mode-map}" (interactive) (kill-all-local-variables) (setq major-mode 'template-mode) (setq mode-name "Template") (use-local-map template-mode-map) (add-hook 'local-write-file-hooks '(lambda () (untabify (point-min) (point-max)))) (run-hooks 'template-mode-hook) (else-mode) ) (defun template-next-definition () "move to next definition" (interactive) (sal-next-thing "^DELETE\\|^DEFINE")) (defun template-prev-definition () "move to previous definition" (interactive) (sal-prev-thing "^DELETE\\|^DEFINE")) (provide 'template-mode) ;;; end of file