summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/otherformats/texsis/base/texsis.el
blob: 41e251e31b04749b21de53605eb4cee40837d7c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
;; file: texsis.el (TeXsis version 2.18)
;; @(#) $Revision: 18.3 $ / $Date: 1998/09/26 23:57:01 $ / $Author: myers $
;;======================================================================*
; GNU emacs support for TeXsis (A TeX macro package for Physicists)
;
; The function texsis-mode makes TeXsis the version of TeX run by the
; commands TeX-buffer and TeX-region.  If the mode is not already
; "TeX" then plain-tex-mode is invoked first.
;
; The function look-for-texsis looks for "\texsis" (or actually, just
; the word "texsis") and sets texsis-mode if such is found.  Put this
; in your TeX-mode-hook to automatically set texsis-mode for TeXsis files.
;
; This file is a part of TeXsis.
;
; Eric Myers, University of Texas at Austin, 22 September 1990
; (with help from lion@navier.stanford.edu -- thanks, leo.)
;======================================================================*

(defun look-for-texsis ()
  "search for \"texsis\" within first 256 characters of the file.
If found, turn on texsis-mode." 
  (goto-char (point-min))
  (if (search-forward "texsis" (min (point-max) (+ (point-min) 255)) t) 
     (texsis-mode))
)


(defun texsis-mode ()  "TeX mode for processing TeXsis files."
  (if (or (equal mode-name "TeX") (equal mode-name "TeXsis") )
      (progn
	(setq TeX-command "texsis")      ;; emacs 18.xx 
	(setq tex-command "texsis")      ;; emacs 19.xx
	(setq mode-name "TeXsis")        ;; mode name is TeXsis
	(goto-char (point-min))
	(message "TeXsis mode.")
	)

    ;; if not a TeX mode then first invoke plain-tex-mode

    (progn
      (plain-tex-mode)
      (if (not (equal mode-name "TeXsis")) (texsis-mode) )
      )  
  )
)