diff options
| author | Richard M. Stallman | 1999-02-07 07:28:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-02-07 07:28:45 +0000 |
| commit | bed1b0c89060d12902dce395774584d78c00e279 (patch) | |
| tree | 412922cdbbf13df7eea61a22fd4863a6d7bccb34 | |
| parent | d6c0ea9945c05af7024226fbe50ffd6cfef6e305 (diff) | |
| download | emacs-bed1b0c89060d12902dce395774584d78c00e279.tar.gz emacs-bed1b0c89060d12902dce395774584d78c00e279.zip | |
When compiling, require compare-w and skeleton
to pacify the byte-compiler. Move the def's of the tex-commands
together. Add a comment on kill-process vs. quit-process.
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 95 |
1 files changed, 50 insertions, 45 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 1d3493e10fd..7a7511c5c17 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -28,6 +28,11 @@ | |||
| 28 | 28 | ||
| 29 | ;;; Code: | 29 | ;;; Code: |
| 30 | 30 | ||
| 31 | ;; Pacify the byte-compiler | ||
| 32 | (eval-when-compile | ||
| 33 | (require 'compare-w) | ||
| 34 | (require 'skeleton)) | ||
| 35 | |||
| 31 | (require 'shell) | 36 | (require 'shell) |
| 32 | (require 'compile) | 37 | (require 'compile) |
| 33 | 38 | ||
| @@ -96,13 +101,6 @@ at the end, with blanks as separators." | |||
| 96 | :type 'string | 101 | :type 'string |
| 97 | :group 'tex-run) | 102 | :group 'tex-run) |
| 98 | 103 | ||
| 99 | (defcustom tex-start-options-string "\\\\nonstopmode\\\\input" | ||
| 100 | "*TeX options to use when running TeX. | ||
| 101 | These precede the input file name." | ||
| 102 | :type 'string | ||
| 103 | :group 'tex-run | ||
| 104 | :version "20.4") | ||
| 105 | |||
| 106 | ;;;###autoload | 104 | ;;;###autoload |
| 107 | (defcustom latex-run-command "latex" | 105 | (defcustom latex-run-command "latex" |
| 108 | "*Command used to run LaTeX subjob. | 106 | "*Command used to run LaTeX subjob. |
| @@ -112,16 +110,31 @@ at the end, with blanks as separators." | |||
| 112 | :type 'string | 110 | :type 'string |
| 113 | :group 'tex-run) | 111 | :group 'tex-run) |
| 114 | 112 | ||
| 113 | ;;;###autoload | ||
| 114 | (defcustom slitex-run-command "slitex" | ||
| 115 | "*Command used to run SliTeX subjob. | ||
| 116 | If this string contains an asterisk (`*'), that is replaced by the file name; | ||
| 117 | otherwise, the file name, preceded by blank, is added at the end." | ||
| 118 | :type 'string | ||
| 119 | :group 'tex-run) | ||
| 120 | |||
| 121 | (defcustom tex-start-options-string "\\\\nonstopmode\\\\input" | ||
| 122 | "*TeX options to use when running TeX. | ||
| 123 | These precede the input file name." | ||
| 124 | :type 'string | ||
| 125 | :group 'tex-run | ||
| 126 | :version "20.4") | ||
| 127 | |||
| 115 | (defvar standard-latex-block-names | 128 | (defvar standard-latex-block-names |
| 116 | '("abstract" "array" "center" "description" | 129 | '("abstract" "array" "center" "description" |
| 117 | "displaymath" "document" "enumerate" "eqnarray" | 130 | "displaymath" "document" "enumerate" "eqnarray" |
| 118 | "eqnarray*" "equation" "figure" "figure*" | 131 | "eqnarray*" "equation" "figure" "figure*" |
| 119 | "flushleft" "flushright" "itemize" "letter" | 132 | "flushleft" "flushright" "itemize" "letter" |
| 120 | "list" "minipage" "picture" "quotation" | 133 | "list" "minipage" "picture" "quotation" |
| 121 | "quote" "slide" "sloppypar" "tabbing" | 134 | "quote" "slide" "sloppypar" "tabbing" |
| 122 | "table" "table*" "tabular" "tabular*" | 135 | "table" "table*" "tabular" "tabular*" |
| 123 | "thebibliography" "theindex*" "titlepage" "trivlist" | 136 | "thebibliography" "theindex*" "titlepage" "trivlist" |
| 124 | "verbatim" "verbatim*" "verse") | 137 | "verbatim" "verbatim*" "verse") |
| 125 | "Standard LaTeX block names.") | 138 | "Standard LaTeX block names.") |
| 126 | 139 | ||
| 127 | ;;;###autoload | 140 | ;;;###autoload |
| @@ -132,14 +145,6 @@ Combined with `standard-latex-block-names' for minibuffer completion." | |||
| 132 | :group 'tex-run) | 145 | :group 'tex-run) |
| 133 | 146 | ||
| 134 | ;;;###autoload | 147 | ;;;###autoload |
| 135 | (defcustom slitex-run-command "slitex" | ||
| 136 | "*Command used to run SliTeX subjob. | ||
| 137 | If this string contains an asterisk (`*'), that is replaced by the file name; | ||
| 138 | otherwise, the file name, preceded by blank, is added at the end." | ||
| 139 | :type 'string | ||
| 140 | :group 'tex-run) | ||
| 141 | |||
| 142 | ;;;###autoload | ||
| 143 | (defcustom tex-bibtex-command "bibtex" | 148 | (defcustom tex-bibtex-command "bibtex" |
| 144 | "*Command used by `tex-bibtex-file' to gather bibliographic data. | 149 | "*Command used by `tex-bibtex-file' to gather bibliographic data. |
| 145 | If this string contains an asterisk (`*'), that is replaced by the file name; | 150 | If this string contains an asterisk (`*'), that is replaced by the file name; |
| @@ -358,7 +363,7 @@ subsubsection\\|paragraph\\|subparagraph\\)\\*?[ \t]*{" nil t) | |||
| 358 | 363 | ||
| 359 | (defvar tex-mode-map nil "Keymap for TeX mode.") | 364 | (defvar tex-mode-map nil "Keymap for TeX mode.") |
| 360 | 365 | ||
| 361 | (if tex-mode-map | 366 | (if tex-mode-map |
| 362 | nil | 367 | nil |
| 363 | (setq tex-mode-map (make-sparse-keymap)) | 368 | (setq tex-mode-map (make-sparse-keymap)) |
| 364 | (tex-define-common-keys tex-mode-map) | 369 | (tex-define-common-keys tex-mode-map) |
| @@ -395,7 +400,6 @@ subsubsection\\|paragraph\\|subparagraph\\)\\*?[ \t]*{" nil t) | |||
| 395 | (put 'tex-recenter-output-buffer 'menu-enable '(get-buffer "*tex-shell*")) | 400 | (put 'tex-recenter-output-buffer 'menu-enable '(get-buffer "*tex-shell*")) |
| 396 | (put 'tex-kill-job 'menu-enable '(tex-shell-running)) | 401 | (put 'tex-kill-job 'menu-enable '(tex-shell-running)) |
| 397 | 402 | ||
| 398 | |||
| 399 | (defvar tex-shell-map nil | 403 | (defvar tex-shell-map nil |
| 400 | "Keymap for the TeX shell. | 404 | "Keymap for the TeX shell. |
| 401 | Inherits `shell-mode-map' with a few additions.") | 405 | Inherits `shell-mode-map' with a few additions.") |
| @@ -413,9 +417,6 @@ Inherits `shell-mode-map' with a few additions.") | |||
| 413 | ,@tex-face-alist) | 417 | ,@tex-face-alist) |
| 414 | "Alist of face and LaTeX font name for facemenu.") | 418 | "Alist of face and LaTeX font name for facemenu.") |
| 415 | 419 | ||
| 416 | |||
| 417 | (defvar compare-windows-whitespace) ; Pacify the byte-compiler | ||
| 418 | |||
| 419 | ;;; This would be a lot simpler if we just used a regexp search, | 420 | ;;; This would be a lot simpler if we just used a regexp search, |
| 420 | ;;; but then it would be too slow. | 421 | ;;; but then it would be too slow. |
| 421 | ;;;###autoload | 422 | ;;;###autoload |
| @@ -542,7 +543,7 @@ tex-show-queue-command | |||
| 542 | Command string used by \\[tex-show-print-queue] to show the print | 543 | Command string used by \\[tex-show-print-queue] to show the print |
| 543 | queue that \\[tex-print] put your job on. | 544 | queue that \\[tex-print] put your job on. |
| 544 | 545 | ||
| 545 | Entering Latex mode runs the hook `text-mode-hook', then | 546 | Entering Latex mode runs the hook `text-mode-hook', then |
| 546 | `tex-mode-hook', and finally `latex-mode-hook'. When the special | 547 | `tex-mode-hook', and finally `latex-mode-hook'. When the special |
| 547 | subshell is initiated, `tex-shell-hook' is run." | 548 | subshell is initiated, `tex-shell-hook' is run." |
| 548 | (interactive) | 549 | (interactive) |
| @@ -709,7 +710,7 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook | |||
| 709 | (setq compare-windows-whitespace 'tex-categorize-whitespace) | 710 | (setq compare-windows-whitespace 'tex-categorize-whitespace) |
| 710 | (make-local-variable 'skeleton-further-elements) | 711 | (make-local-variable 'skeleton-further-elements) |
| 711 | (setq skeleton-further-elements | 712 | (setq skeleton-further-elements |
| 712 | '((indent-line-function 'indent-relative-maybe))) | 713 | '((indent-line-function 'indent-relative-maybe))) |
| 713 | (make-local-variable 'facemenu-add-face-function) | 714 | (make-local-variable 'facemenu-add-face-function) |
| 714 | (make-local-variable 'facemenu-end-add-face) | 715 | (make-local-variable 'facemenu-end-add-face) |
| 715 | (make-local-variable 'facemenu-remove-face-function) | 716 | (make-local-variable 'facemenu-remove-face-function) |
| @@ -823,7 +824,7 @@ on the line for the invalidity you want to see." | |||
| 823 | (setq linenum (- linenum (count-lines prevpos (point)))) | 824 | (setq linenum (- linenum (count-lines prevpos (point)))) |
| 824 | (setq linenum (1+ (count-lines 1 start)))) | 825 | (setq linenum (1+ (count-lines 1 start)))) |
| 825 | (setq prevpos (point)) | 826 | (setq prevpos (point)) |
| 826 | ;; Mention this mismatch in *Occur*. | 827 | ;; Mention this mismatch in *Occur*. |
| 827 | ;; Since we scan from end of buffer to beginning, | 828 | ;; Since we scan from end of buffer to beginning, |
| 828 | ;; add each mismatch at the beginning of *Occur*. | 829 | ;; add each mismatch at the beginning of *Occur*. |
| 829 | (save-excursion | 830 | (save-excursion |
| @@ -877,8 +878,8 @@ area if a mismatch is found." | |||
| 877 | (error "Mismatched parentheses")))) | 878 | (error "Mismatched parentheses")))) |
| 878 | (forward-char 1))) | 879 | (forward-char 1))) |
| 879 | (error | 880 | (error |
| 880 | (skip-syntax-forward " .>") | 881 | (skip-syntax-forward " .>") |
| 881 | (setq failure-point (point))))) | 882 | (setq failure-point (point))))) |
| 882 | (if failure-point | 883 | (if failure-point |
| 883 | (progn | 884 | (progn |
| 884 | (goto-char failure-point) | 885 | (goto-char failure-point) |
| @@ -893,10 +894,10 @@ A prefix arg inhibits the checking." | |||
| 893 | (or inhibit-validation | 894 | (or inhibit-validation |
| 894 | (save-excursion | 895 | (save-excursion |
| 895 | (tex-validate-region | 896 | (tex-validate-region |
| 896 | (save-excursion | 897 | (save-excursion |
| 897 | (search-backward "\n\n" nil 'move) | 898 | (search-backward "\n\n" nil 'move) |
| 898 | (point)) | 899 | (point)) |
| 899 | (point))) | 900 | (point))) |
| 900 | (message "Paragraph being closed appears to contain a mismatch")) | 901 | (message "Paragraph being closed appears to contain a mismatch")) |
| 901 | (insert "\n\n")) | 902 | (insert "\n\n")) |
| 902 | 903 | ||
| @@ -913,7 +914,7 @@ A prefix arg inhibits the checking." | |||
| 913 | (defun latex-fill-nobreak-predicate () | 914 | (defun latex-fill-nobreak-predicate () |
| 914 | (let ((opoint (point)) | 915 | (let ((opoint (point)) |
| 915 | inside) | 916 | inside) |
| 916 | (save-excursion | 917 | (save-excursion |
| 917 | (save-restriction | 918 | (save-restriction |
| 918 | (beginning-of-line) | 919 | (beginning-of-line) |
| 919 | (narrow-to-region (point) opoint) | 920 | (narrow-to-region (point) opoint) |
| @@ -1004,7 +1005,7 @@ Mark is left at original location." | |||
| 1004 | (defun tex-feed-input () | 1005 | (defun tex-feed-input () |
| 1005 | "Send input to the tex shell process. | 1006 | "Send input to the tex shell process. |
| 1006 | In the tex buffer this can be used to continue an interactive tex run. | 1007 | In the tex buffer this can be used to continue an interactive tex run. |
| 1007 | In the tex shell buffer this command behaves like `comint-send-input'." | 1008 | In the tex shell buffer this command behaves like `comint-send-input'." |
| 1008 | (interactive) | 1009 | (interactive) |
| 1009 | (set-buffer (process-buffer (get-process "tex-shell"))) | 1010 | (set-buffer (process-buffer (get-process "tex-shell"))) |
| 1010 | (comint-send-input) | 1011 | (comint-send-input) |
| @@ -1252,7 +1253,7 @@ The value of `tex-command' specifies the command to use to run TeX." | |||
| 1252 | ;; Maybe copy first line, such as `\input texinfo', to temp file. | 1253 | ;; Maybe copy first line, such as `\input texinfo', to temp file. |
| 1253 | (and tex-first-line-header-regexp | 1254 | (and tex-first-line-header-regexp |
| 1254 | (looking-at tex-first-line-header-regexp) | 1255 | (looking-at tex-first-line-header-regexp) |
| 1255 | (write-region (point) | 1256 | (write-region (point) |
| 1256 | (progn (forward-line 1) | 1257 | (progn (forward-line 1) |
| 1257 | (setq already-output (point))) | 1258 | (setq already-output (point))) |
| 1258 | tex-out-file nil nil)) | 1259 | tex-out-file nil nil)) |
| @@ -1267,7 +1268,7 @@ The value of `tex-command' specifies the command to use to run TeX." | |||
| 1267 | (if (re-search-forward tex-end-of-header nil t) | 1268 | (if (re-search-forward tex-end-of-header nil t) |
| 1268 | (let (hend) | 1269 | (let (hend) |
| 1269 | (forward-line 1) | 1270 | (forward-line 1) |
| 1270 | (setq hend (point)) ;mark end of header | 1271 | (setq hend (point)) ;mark end of header |
| 1271 | (write-region (max (min hbeg beg) already-output) | 1272 | (write-region (max (min hbeg beg) already-output) |
| 1272 | hend | 1273 | hend |
| 1273 | tex-out-file | 1274 | tex-out-file |
| @@ -1310,7 +1311,7 @@ This function is more useful than \\[tex-buffer] when you need the | |||
| 1310 | `.aux' file of LaTeX to have the correct name." | 1311 | `.aux' file of LaTeX to have the correct name." |
| 1311 | (interactive) | 1312 | (interactive) |
| 1312 | (let ((source-file | 1313 | (let ((source-file |
| 1313 | (or tex-main-file | 1314 | (or tex-main-file |
| 1314 | (if (buffer-file-name) | 1315 | (if (buffer-file-name) |
| 1315 | (file-name-nondirectory (buffer-file-name)) | 1316 | (file-name-nondirectory (buffer-file-name)) |
| 1316 | (error "Buffer does not seem to be associated with any file")))) | 1317 | (error "Buffer does not seem to be associated with any file")))) |
| @@ -1363,6 +1364,10 @@ This function is more useful than \\[tex-buffer] when you need the | |||
| 1363 | (defun tex-kill-job () | 1364 | (defun tex-kill-job () |
| 1364 | "Kill the currently running TeX job." | 1365 | "Kill the currently running TeX job." |
| 1365 | (interactive) | 1366 | (interactive) |
| 1367 | ;; quit-process leads to core dumps of the tex process (except if | ||
| 1368 | ;; coredumpsize has limit 0kb as on many environments). One would | ||
| 1369 | ;; like to use (kill-process proc 'lambda), however that construct | ||
| 1370 | ;; does not work on some systems and kills the shell itself. | ||
| 1366 | (quit-process (get-process "tex-shell") t)) | 1371 | (quit-process (get-process "tex-shell") t)) |
| 1367 | 1372 | ||
| 1368 | (defun tex-recenter-output-buffer (linenum) | 1373 | (defun tex-recenter-output-buffer (linenum) |
| @@ -1404,8 +1409,8 @@ is provided, use the alternative command, `tex-alt-dvi-print-command'." | |||
| 1404 | (tex-kill-job) | 1409 | (tex-kill-job) |
| 1405 | (tex-start-shell)) | 1410 | (tex-start-shell)) |
| 1406 | (tex-send-command | 1411 | (tex-send-command |
| 1407 | (if alt tex-alt-dvi-print-command tex-dvi-print-command) | 1412 | (if alt tex-alt-dvi-print-command tex-dvi-print-command) |
| 1408 | print-file-name-dvi t)))) | 1413 | print-file-name-dvi t)))) |
| 1409 | 1414 | ||
| 1410 | (defun tex-alt-print () | 1415 | (defun tex-alt-print () |
| 1411 | "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. | 1416 | "Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. |