aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman1999-02-16 10:39:24 +0000
committerRichard M. Stallman1999-02-16 10:39:24 +0000
commitc3ce7bf4ec837fe30bbbd49cb204d725bab7db80 (patch)
treee9775caba67b6823bd73316f7044c44986a839a0 /lisp/textmodes
parent6c18d2f5c561d4a3d4c63788841bc35b126a5add (diff)
downloademacs-c3ce7bf4ec837fe30bbbd49cb204d725bab7db80.tar.gz
emacs-c3ce7bf4ec837fe30bbbd49cb204d725bab7db80.zip
(tex-run-command, latex-run-command)
(slitex-run-command, tex-command): Doc changes. (tex-start-options-string): Autoload it. Doc change. Provide a menu for customization. Allow nil. Quote backslashes only once. (tex-start-tex): Handle nil value of tex-start-options-string and apply shell-quote-argument to it.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/tex-mode.el46
1 files changed, 28 insertions, 18 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 7a7511c5c17..1f248699758 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1,6 +1,6 @@
1;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands. 1;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands.
2 2
3;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 1998 3;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 98, 1999
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -95,33 +95,36 @@ if the variable is non-nil."
95;;;###autoload 95;;;###autoload
96(defcustom tex-run-command "tex" 96(defcustom tex-run-command "tex"
97 "*Command used to run TeX subjob. 97 "*Command used to run TeX subjob.
98If this string contains an asterisk (`*'), that is replaced by the file name; 98TeX Mode sets `tex-command' to this string.
99otherwise the value of `tex-start-options-string' and the file name are added 99See the documentation of that variable."
100at the end, with blanks as separators."
101 :type 'string 100 :type 'string
102 :group 'tex-run) 101 :group 'tex-run)
103 102
104;;;###autoload 103;;;###autoload
105(defcustom latex-run-command "latex" 104(defcustom latex-run-command "latex"
106 "*Command used to run LaTeX subjob. 105 "*Command used to run LaTeX subjob.
107If this string contains an asterisk (`*'), that is replaced by the file name; 106LaTeX Mode sets `tex-command' to this string.
108otherwise the value of `tex-start-options-string' and the file name are added 107See the documentation of that variable."
109at the end, with blanks as separators."
110 :type 'string 108 :type 'string
111 :group 'tex-run) 109 :group 'tex-run)
112 110
113;;;###autoload 111;;;###autoload
114(defcustom slitex-run-command "slitex" 112(defcustom slitex-run-command "slitex"
115 "*Command used to run SliTeX subjob. 113 "*Command used to run SliTeX subjob.
116If this string contains an asterisk (`*'), that is replaced by the file name; 114SliTeX Mode sets `tex-command' to this string.
117otherwise, the file name, preceded by blank, is added at the end." 115See the documentation of that variable."
118 :type 'string 116 :type 'string
119 :group 'tex-run) 117 :group 'tex-run)
120 118
121(defcustom tex-start-options-string "\\\\nonstopmode\\\\input" 119;;;###autoload
120(defcustom tex-start-options-string "\\nonstopmode\\input"
122 "*TeX options to use when running TeX. 121 "*TeX options to use when running TeX.
123These precede the input file name." 122These precede the input file name. If nil, TeX runs without option.
124 :type 'string 123See the documentation of `tex-command'."
124 :type '(radio (const :tag "Interactive \(nil\)" nil)
125 (const :tag "Nonstop \(\"\\nonstopmode\\input\"\)"
126 "\\nonstopmode\\input")
127 (string :tag "String at your choice"))
125 :group 'tex-run 128 :group 'tex-run
126 :version "20.4") 129 :version "20.4")
127 130
@@ -230,9 +233,14 @@ Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the
230tex shell terminates.") 233tex shell terminates.")
231 234
232(defvar tex-command nil 235(defvar tex-command nil
233 "Command to run TeX. 236 "*Command to run TeX.
234The usual values are `tex-run-command' and `latex-run-command'. 237If this string contains an asterisk \(`*'\), that is replaced by the file name\;
235See the documentations of these variables.") 238otherwise the \(shell-quoted\) value of `tex-start-options-string' and
239the file name are added at the end, with blanks as separators.
240
241In TeX, LaTeX, and SliTeX Mode this variable becomes buffer local.
242In these modes, use \\[set-variable] if you want to change it for the
243current buffer.")
236 244
237(defvar tex-trailer nil 245(defvar tex-trailer nil
238 "String appended after the end of a region sent to TeX by \\[tex-region].") 246 "String appended after the end of a region sent to TeX by \\[tex-region].")
@@ -449,6 +457,8 @@ says which mode to use."
449;;;###autoload 457;;;###autoload
450(defalias 'TeX-mode 'tex-mode) 458(defalias 'TeX-mode 'tex-mode)
451;;;###autoload 459;;;###autoload
460(defalias 'plain-TeX-mode 'plain-tex-mode)
461;;;###autoload
452(defalias 'LaTeX-mode 'latex-mode) 462(defalias 'LaTeX-mode 'latex-mode)
453 463
454;;;###autoload 464;;;###autoload
@@ -502,8 +512,6 @@ special subshell is initiated, the hook `tex-shell-hook' is run."
502 (setq tex-end-of-header "%\\*\\*end of header") 512 (setq tex-end-of-header "%\\*\\*end of header")
503 (setq tex-trailer "\\bye\n") 513 (setq tex-trailer "\\bye\n")
504 (run-hooks 'text-mode-hook 'tex-mode-hook 'plain-tex-mode-hook)) 514 (run-hooks 'text-mode-hook 'tex-mode-hook 'plain-tex-mode-hook))
505;;;###autoload
506(defalias 'plain-TeX-mode 'plain-tex-mode)
507 515
508;;;###autoload 516;;;###autoload
509(defun latex-mode () 517(defun latex-mode ()
@@ -1102,7 +1110,9 @@ If NOT-ALL is non-nil, save the `.dvi' file."
1102 (comint-quote-filename file) 1110 (comint-quote-filename file)
1103 (substring command (1+ star))) 1111 (substring command (1+ star)))
1104 (concat command " " 1112 (concat command " "
1105 (comint-quote-filename tex-start-options-string) " " 1113 (if (< 0 (length tex-start-options-string))
1114 (concat
1115 (shell-quote-argument tex-start-options-string) " "))
1106 (comint-quote-filename file))))) 1116 (comint-quote-filename file)))))
1107 (with-current-buffer (process-buffer (tex-send-command compile-command)) 1117 (with-current-buffer (process-buffer (tex-send-command compile-command))
1108 (save-excursion 1118 (save-excursion