;;; matlab-mode.el --- major mode providing a matlab mode hook for fontification ;;;* Last edited: Mar 23 16:08 1995 (cvieri) ;; Author: 1994 Carlin J. Vieri, MIT AI Lab ;; Keywords: Matlab editing major-mode ;; Nearly identical to spice-mode.el ;; Copyright (C) 1994, MIT Artificial Intelligence Lab ;; This file 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 2, or (at your option) ;; any later version. ;; This file 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, 675 Mass Ave, Cambridge, MA 02139, USA. ;; If you have any questions about this mode, feel free to contact me ;; at the following address: cvieri@ai.mit.edu. If you make any ;; modifications or bug fixes, I'd like to hear about them. ;; To use matlab-mode, add the following to your .emacs file. This ;; assumes that you will use the .sp extension for your matlab source deck: ;; (autoload 'matlab-mode "matlab-mode" "Matlab Editing Mode" t) ;; (setq auto-mode-alist ;; (append '(("\\.m$" . matlab-mode) ;; ("\\.mat$" . matlab-mode) ;; ) auto-mode-alist)) ;; (defvar matlab-mode-syntax-table nil "Syntax table used in matlab-mode buffers.") (if matlab-mode-syntax-table () (setq matlab-mode-syntax-table (make-syntax-table)) (modify-syntax-entry ?% "<" matlab-mode-syntax-table) ; (modify-syntax-entry ?$ "<" matlab-mode-syntax-table) (modify-syntax-entry ?\n ">" matlab-mode-syntax-table)) (defvar matlab-mode-abbrev-table nil "Abbrev table in use in matlab-mode buffers.") (define-abbrev-table 'matlab-mode-abbrev-table ()) (defvar matlab-mode-map () "Keymap used in matlab-mode.") (if matlab-mode-map () (setq matlab-mode-map (make-sparse-keymap)) (install-common-language-commands matlab-mode-map)) ;; ====================================================================== ;; matlab-mode main entry point ;; ====================================================================== ;;;###autoload (defun matlab-mode () "Major mode for editing matlab decks. 0.0 No bug report notification is currently available. No indentation is implemented; this mode provides a fontification hook. Common language commands and key bindings are linked through this command. Turning on Matlab mode calls the value of the variable `matlab-mode-hook' with no args, if that value is non-nil." (interactive) (kill-all-local-variables) (use-local-map matlab-mode-map) (set-syntax-table matlab-mode-syntax-table) (setq major-mode 'matlab-mode mode-name "Matlab") (set (make-local-variable 'paragraph-start) (concat "^$\\|" page-delimiter)) (set (make-local-variable 'paragraph-separate) paragraph-start) (set (make-local-variable 'paragraph-ignore-fill-prefix) t) (set (make-local-variable 'require-final-newline) t) (set (make-local-variable 'parse-sexp-ignore-comments) nil) (set (make-local-variable 'comment-start) "% ") (set (make-local-variable 'comment-end) "") (set (make-local-variable 'comment-column) 32) (run-hooks 'matlab-mode-hook) ) ;; this is sometimes useful (provide 'matlab-mode) ;;; matlab-mode.el ends here