;;; ahsdb.el - editing mode for AHS database entries. ;; v. 1.00 7/1999 ;; Copyright (C) Judah Milgram ;; bug reports/comments/suggestions welcome ;; This file is not part of GNU Emacs. ;; 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 2, 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 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. ;; =========================================================================== ;; syntax - leave it in, we might fool with it later. (defvar ahsdb-mode-syntax-table nil "Syntax table for ahsdb-mode." ) (if ahsdb-mode-syntax-table () (setq ahsdb-mode-syntax-table (make-syntax-table)) ; (modify-syntax-entry ?\\ "\\" ahsdb-mode-syntax-table) (modify-syntax-entry ?\n "> " ahsdb-mode-syntax-table) (modify-syntax-entry ?\f "> " ahsdb-mode-syntax-table) ; (modify-syntax-entry ?\* "< " ahsdb-mode-syntax-table) (modify-syntax-entry ?# "< " ahsdb-mode-syntax-table) ; (modify-syntax-entry ?/ "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?* "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?+ "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?- "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?@ "_" ahsdb-mode-syntax-table) ; (modify-syntax-entry ?= "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?% "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?< "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?> "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?& "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?| "." ahsdb-mode-syntax-table) ; (modify-syntax-entry ?_ "_" ahsdb-mode-syntax-table) ; (modify-syntax-entry ?\' "\"" ahsdb-mode-syntax-table) ) (defconst ahsdb-font-lock-keywords (eval-when-compile (list (concat "\\<\\(" "@SUBMITTED\\|" "@PASSPHRASE\\|" "@KEY\\|" "@TITLE\\|" "@AUTHOR\\|" "@ABSTRACT\\|" "@DATE\\|" "@MONTH\\|" "@YEAR\\|" "@SOURCE\\|" "@PAGES\\|" "@VOLUME\\|" "@NUMBER\\|" "@ADDRESS\\|" "@DOCKEY\\|" "@KEYWORDS\\|" "@NOTES\\|" "\\)\\>") )) "Keywords to highlight in ahsdb mode.") (defun ahsdb-mode () "Major mode for editing ahsdb database entries. Turning on ahsdb mode calls the value of the variable `ahsdb-mode-hook' with no args, if that value is non-nil." (interactive) (kill-all-local-variables) (setq major-mode 'ahsdb-mode) (setq mode-name "ahsdb") ; (setq local-abbrev-table ahsdb-mode-abbrev-table) (set-syntax-table ahsdb-mode-syntax-table) ; (make-local-variable 'paragraph-start) ; (setq paragraph-start (concat "$\\|" page-delimiter)) ; (make-local-variable 'paragraph-separate) ; (setq paragraph-separate paragraph-start) ; (make-local-variable 'paragraph-ignore-fill-prefix) ; (setq paragraph-ignore-fill-prefix t) ; (make-local-variable 'indent-line-function) ; (setq indent-line-function 'c-indent-line) ; (make-local-variable 'require-final-newline) ; (setq require-final-newline t) ; (make-local-variable 'comment-start) ; (setq comment-start "@ ") ; (make-local-variable 'comment-end) ; (setq comment-end "\n") ; (make-local-variable 'comment-column) ; (setq comment-column 32) ; (make-local-variable 'comment-start-skip) ; (setq comment-start-skip "\*+ *") ; (make-local-variable 'comment-indent-function) ; (setq comment-indent-function 'c-comment-indent) ; (make-local-variable 'parse-sexp-ignore-comments) ; (setq parse-sexp-ignore-comments t) (make-local-variable 'font-lock-defaults) ; (setq font-lock-defaults '(ahsdb-font-lock-keywords nil t ((?_ . "w")) nil) ) (setq font-lock-defaults '(ahsdb-font-lock-keywords nil t ((?@ . "w")) nil) ) (font-lock-mode) (font-lock-fontify-buffer) (setq paragraph-start "[#@ ]") (setq paragraph-separate "[#@ ]") (auto-fill-mode) ; add stuff for ispell here. (run-hooks 'ahsdb-mode-hook)) (provide 'ahsdb-mode) (ahsdb-mode) ;;; end ahsdb.el