comparison lisp/textmodes/tex-mode.el @ 22139:4a0e11be3592

(tex-command-end): New variable. (tex-start-tex): Use it. (plain-tex-mode): Locally set tex-command-end. (tex-common-initialization): Make local binding for it.x
author Richard M. Stallman <rms@gnu.org>
date Tue, 19 May 1998 04:27:28 +0000
parents 9e91515ab6ed
children a4324fe3e21e
comparison
equal deleted inserted replaced
22138:d4ac295a98b3 22139:4a0e11be3592
215 tex shell terminates.") 215 tex shell terminates.")
216 216
217 (defvar tex-command nil 217 (defvar tex-command nil
218 "Command to run TeX. 218 "Command to run TeX.
219 The name of the file, preceded by a blank, will be added to this string.") 219 The name of the file, preceded by a blank, will be added to this string.")
220
221 (defvar tex-command-end ""
222 "String to add to the end of the command to run TeX.")
220 223
221 (defvar tex-trailer nil 224 (defvar tex-trailer nil
222 "String appended after the end of a region sent to TeX by \\[tex-region].") 225 "String appended after the end of a region sent to TeX by \\[tex-region].")
223 226
224 (defvar tex-start-of-header nil 227 (defvar tex-start-of-header nil
482 (interactive) 485 (interactive)
483 (tex-common-initialization) 486 (tex-common-initialization)
484 (setq mode-name "TeX") 487 (setq mode-name "TeX")
485 (setq major-mode 'plain-tex-mode) 488 (setq major-mode 'plain-tex-mode)
486 (setq tex-command tex-run-command) 489 (setq tex-command tex-run-command)
490 (setq tex-command-end " \\\\nonstopmode\\\\input")
487 (setq tex-start-of-header "%\\*\\*start of header") 491 (setq tex-start-of-header "%\\*\\*start of header")
488 (setq tex-end-of-header "%\\*\\*end of header") 492 (setq tex-end-of-header "%\\*\\*end of header")
489 (setq tex-trailer "\\bye\n") 493 (setq tex-trailer "\\bye\n")
490 (run-hooks 'text-mode-hook 'tex-mode-hook 'plain-tex-mode-hook)) 494 (run-hooks 'text-mode-hook 'tex-mode-hook 'plain-tex-mode-hook))
491 ;;;###autoload 495 ;;;###autoload
707 face-text 711 face-text
708 (error "Face %s not configured for %s mode" face mode-name)))) 712 (error "Face %s not configured for %s mode" face mode-name))))
709 facemenu-end-add-face "}" 713 facemenu-end-add-face "}"
710 facemenu-remove-face-function t) 714 facemenu-remove-face-function t)
711 (make-local-variable 'tex-command) 715 (make-local-variable 'tex-command)
716 (make-local-variable 'tex-command-end)
712 (make-local-variable 'tex-start-of-header) 717 (make-local-variable 'tex-start-of-header)
713 (make-local-variable 'tex-end-of-header) 718 (make-local-variable 'tex-end-of-header)
714 (make-local-variable 'tex-trailer)) 719 (make-local-variable 'tex-trailer))
715 720
716 (defun tex-comment-indent () 721 (defun tex-comment-indent ()
1060 (defvar tex-start-tex-marker nil 1065 (defvar tex-start-tex-marker nil
1061 "Marker pointing after last TeX-running command in the TeX shell buffer.") 1066 "Marker pointing after last TeX-running command in the TeX shell buffer.")
1062 1067
1063 (defun tex-start-tex (command file) 1068 (defun tex-start-tex (command file)
1064 "Start a TeX run, using COMMAND on FILE." 1069 "Start a TeX run, using COMMAND on FILE."
1065 (let* ((cmd (concat command " \\\\nonstopmode\\\\input")) 1070 (let* ((cmd (concat command text-command-end))
1066 (star (string-match "\\*" cmd)) 1071 (star (string-match "\\*" cmd))
1067 (compile-command 1072 (compile-command
1068 (if star (concat (substring cmd 0 star) 1073 (if star (concat (substring cmd 0 star)
1069 file (substring cmd (1+ star))) 1074 file (substring cmd (1+ star)))
1070 (concat cmd " " file)))) 1075 (concat cmd " " file))))