;;; Code:
+;; Pacify the byte-compiler
+(eval-when-compile
+ (require 'compare-w)
+ (require 'skeleton))
+
(require 'shell)
(require 'compile)
:type 'string
:group 'tex-run)
-(defcustom tex-start-options-string "\\\\nonstopmode\\\\input"
- "*TeX options to use when running TeX.
-These precede the input file name."
- :type 'string
- :group 'tex-run
- :version "20.4")
-
;;;###autoload
(defcustom latex-run-command "latex"
"*Command used to run LaTeX subjob.
:type 'string
:group 'tex-run)
+;;;###autoload
+(defcustom slitex-run-command "slitex"
+ "*Command used to run SliTeX subjob.
+If this string contains an asterisk (`*'), that is replaced by the file name;
+otherwise, the file name, preceded by blank, is added at the end."
+ :type 'string
+ :group 'tex-run)
+
+(defcustom tex-start-options-string "\\\\nonstopmode\\\\input"
+ "*TeX options to use when running TeX.
+These precede the input file name."
+ :type 'string
+ :group 'tex-run
+ :version "20.4")
+
(defvar standard-latex-block-names
- '("abstract" "array" "center" "description"
- "displaymath" "document" "enumerate" "eqnarray"
- "eqnarray*" "equation" "figure" "figure*"
- "flushleft" "flushright" "itemize" "letter"
- "list" "minipage" "picture" "quotation"
- "quote" "slide" "sloppypar" "tabbing"
- "table" "table*" "tabular" "tabular*"
- "thebibliography" "theindex*" "titlepage" "trivlist"
- "verbatim" "verbatim*" "verse")
+ '("abstract" "array" "center" "description"
+ "displaymath" "document" "enumerate" "eqnarray"
+ "eqnarray*" "equation" "figure" "figure*"
+ "flushleft" "flushright" "itemize" "letter"
+ "list" "minipage" "picture" "quotation"
+ "quote" "slide" "sloppypar" "tabbing"
+ "table" "table*" "tabular" "tabular*"
+ "thebibliography" "theindex*" "titlepage" "trivlist"
+ "verbatim" "verbatim*" "verse")
"Standard LaTeX block names.")
;;;###autoload
:type '(repeat string)
:group 'tex-run)
-;;;###autoload
-(defcustom slitex-run-command "slitex"
- "*Command used to run SliTeX subjob.
-If this string contains an asterisk (`*'), that is replaced by the file name;
-otherwise, the file name, preceded by blank, is added at the end."
- :type 'string
- :group 'tex-run)
-
;;;###autoload
(defcustom tex-bibtex-command "bibtex"
"*Command used by `tex-bibtex-file' to gather bibliographic data.
(defvar tex-mode-map nil "Keymap for TeX mode.")
-(if tex-mode-map
+(if tex-mode-map
nil
(setq tex-mode-map (make-sparse-keymap))
(tex-define-common-keys tex-mode-map)
(put 'tex-recenter-output-buffer 'menu-enable '(get-buffer "*tex-shell*"))
(put 'tex-kill-job 'menu-enable '(tex-shell-running))
-
(defvar tex-shell-map nil
"Keymap for the TeX shell.
Inherits `shell-mode-map' with a few additions.")
,@tex-face-alist)
"Alist of face and LaTeX font name for facemenu.")
-
-(defvar compare-windows-whitespace) ; Pacify the byte-compiler
-
;;; This would be a lot simpler if we just used a regexp search,
;;; but then it would be too slow.
;;;###autoload
Command string used by \\[tex-show-print-queue] to show the print
queue that \\[tex-print] put your job on.
-Entering Latex mode runs the hook `text-mode-hook', then
+Entering Latex mode runs the hook `text-mode-hook', then
`tex-mode-hook', and finally `latex-mode-hook'. When the special
subshell is initiated, `tex-shell-hook' is run."
(interactive)
(setq compare-windows-whitespace 'tex-categorize-whitespace)
(make-local-variable 'skeleton-further-elements)
(setq skeleton-further-elements
- '((indent-line-function 'indent-relative-maybe)))
+ '((indent-line-function 'indent-relative-maybe)))
(make-local-variable 'facemenu-add-face-function)
(make-local-variable 'facemenu-end-add-face)
(make-local-variable 'facemenu-remove-face-function)
(setq linenum (- linenum (count-lines prevpos (point))))
(setq linenum (1+ (count-lines 1 start))))
(setq prevpos (point))
- ;; Mention this mismatch in *Occur*.
+ ;; Mention this mismatch in *Occur*.
;; Since we scan from end of buffer to beginning,
;; add each mismatch at the beginning of *Occur*.
(save-excursion
(error "Mismatched parentheses"))))
(forward-char 1)))
(error
- (skip-syntax-forward " .>")
- (setq failure-point (point)))))
+ (skip-syntax-forward " .>")
+ (setq failure-point (point)))))
(if failure-point
(progn
(goto-char failure-point)
(or inhibit-validation
(save-excursion
(tex-validate-region
- (save-excursion
- (search-backward "\n\n" nil 'move)
- (point))
- (point)))
+ (save-excursion
+ (search-backward "\n\n" nil 'move)
+ (point))
+ (point)))
(message "Paragraph being closed appears to contain a mismatch"))
(insert "\n\n"))
(defun latex-fill-nobreak-predicate ()
(let ((opoint (point))
inside)
- (save-excursion
+ (save-excursion
(save-restriction
(beginning-of-line)
(narrow-to-region (point) opoint)
(defun tex-feed-input ()
"Send input to the tex shell process.
In the tex buffer this can be used to continue an interactive tex run.
-In the tex shell buffer this command behaves like `comint-send-input'."
+In the tex shell buffer this command behaves like `comint-send-input'."
(interactive)
(set-buffer (process-buffer (get-process "tex-shell")))
(comint-send-input)
;; Maybe copy first line, such as `\input texinfo', to temp file.
(and tex-first-line-header-regexp
(looking-at tex-first-line-header-regexp)
- (write-region (point)
+ (write-region (point)
(progn (forward-line 1)
(setq already-output (point)))
tex-out-file nil nil))
(if (re-search-forward tex-end-of-header nil t)
(let (hend)
(forward-line 1)
- (setq hend (point)) ;mark end of header
+ (setq hend (point)) ;mark end of header
(write-region (max (min hbeg beg) already-output)
hend
tex-out-file
`.aux' file of LaTeX to have the correct name."
(interactive)
(let ((source-file
- (or tex-main-file
+ (or tex-main-file
(if (buffer-file-name)
(file-name-nondirectory (buffer-file-name))
(error "Buffer does not seem to be associated with any file"))))
(defun tex-kill-job ()
"Kill the currently running TeX job."
(interactive)
+ ;; quit-process leads to core dumps of the tex process (except if
+ ;; coredumpsize has limit 0kb as on many environments). One would
+ ;; like to use (kill-process proc 'lambda), however that construct
+ ;; does not work on some systems and kills the shell itself.
(quit-process (get-process "tex-shell") t))
(defun tex-recenter-output-buffer (linenum)
(tex-kill-job)
(tex-start-shell))
(tex-send-command
- (if alt tex-alt-dvi-print-command tex-dvi-print-command)
- print-file-name-dvi t))))
+ (if alt tex-alt-dvi-print-command tex-dvi-print-command)
+ print-file-name-dvi t))))
(defun tex-alt-print ()
"Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file].