| 1 |
;; file: texsis.el (TeXsis version 2.18) |
| 2 |
;; @(#) $Revision: 18.3 $ / $Date: 1998/09/26 23:57:01 $ / $Author: myers $ |
| 3 |
;;======================================================================* |
| 4 |
; GNU emacs support for TeXsis (A TeX macro package for Physicists) |
| 5 |
; |
| 6 |
; The function texsis-mode makes TeXsis the version of TeX run by the |
| 7 |
; commands TeX-buffer and TeX-region. If the mode is not already |
| 8 |
; "TeX" then plain-tex-mode is invoked first. |
| 9 |
; |
| 10 |
; The function look-for-texsis looks for "\texsis" (or actually, just |
| 11 |
; the word "texsis") and sets texsis-mode if such is found. Put this |
| 12 |
; in your TeX-mode-hook to automatically set texsis-mode for TeXsis files. |
| 13 |
; |
| 14 |
; This file is a part of TeXsis. |
| 15 |
; |
| 16 |
; Eric Myers, University of Texas at Austin, 22 September 1990 |
| 17 |
; (with help from [email protected] -- thanks, leo.) |
| 18 |
;======================================================================* |
| 19 |
|
| 20 |
(defun look-for-texsis () |
| 21 |
"search for \"texsis\" within first 256 characters of the file. |
| 22 |
If found, turn on texsis-mode." |
| 23 |
(goto-char (point-min)) |
| 24 |
(if (search-forward "texsis" (min (point-max) (+ (point-min) 255)) t) |
| 25 |
(texsis-mode)) |
| 26 |
) |
| 27 |
|
| 28 |
|
| 29 |
(defun texsis-mode () "TeX mode for processing TeXsis files." |
| 30 |
(if (or (equal mode-name "TeX") (equal mode-name "TeXsis") ) |
| 31 |
(progn |
| 32 |
(setq TeX-command "texsis") ;; emacs 18.xx |
| 33 |
(setq tex-command "texsis") ;; emacs 19.xx |
| 34 |
(setq mode-name "TeXsis") ;; mode name is TeXsis |
| 35 |
(goto-char (point-min)) |
| 36 |
(message "TeXsis mode.") |
| 37 |
) |
| 38 |
|
| 39 |
;; if not a TeX mode then first invoke plain-tex-mode |
| 40 |
|
| 41 |
(progn |
| 42 |
(plain-tex-mode) |
| 43 |
(if (not (equal mode-name "TeXsis")) (texsis-mode) ) |
| 44 |
) |
| 45 |
) |
| 46 |
) |