;ELC ;;; compiled by rms@mole.gnu.ai.mit.edu on Wed Aug 17 18:35:31 1994 ;;; from file /home/fsf/rms/e19/lisp/tex-mode.el ;;; emacs version 19.25.93.1. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/home/fsf/rms/e19/lisp/tex-mode.el' was compiled for Emacs 19")) (byte-code "!!" [require shell compile] 2) (defvar tex-shell-file-name nil "\ *If non-nil, the shell file name to run in the subshell used to run TeX.") (defvar tex-directory "." "\ *Directory in which temporary files are left. You can make this `/tmp' if your TEXINPUTS has no relative directories in it and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are `\\input' commands with relative directories.") (defvar tex-offer-save t "\ *If non-nil, ask about saving modified buffers before \\[tex-file] is run.") (defvar tex-run-command "tex" "\ *Command used to run TeX 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.") (defvar latex-run-command "latex" "\ *Command used to run LaTeX 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.") (defvar standard-latex-block-names (quote ("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.") (defvar latex-block-names nil "\ *User defined LaTeX block names. Combined with `standard-latex-block-names' for minibuffer completion.") (defvar 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.") (defvar tex-bibtex-command "bibtex" "\ *Command used by `tex-bibtex-file' to gather bibliographic data. 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.") (defvar tex-dvi-print-command "lpr -d" "\ *Command used by \\[tex-print] to print a .dvi file. 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.") (defvar tex-alt-dvi-print-command "lpr -d" "\ *Command used by \\[tex-print] with a prefix arg to print a .dvi file. 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. If two printers are not enough of a choice, you can set the variable `tex-alt-dvi-print-command' to an expression that asks what you want; for example, (setq tex-alt-dvi-print-command '(format \"lpr -P%s\" (read-string \"Use printer: \"))) would tell \\[tex-print] with a prefix argument to ask you which printer to use.") (defvar tex-dvi-view-command nil "\ *Command used by \\[tex-view] to display a `.dvi' file. 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. This can be set conditionally so that the previewer used is suitable for the window system being used. For example, (setq tex-dvi-view-command (if (eq window-system 'x) \"xdvi\" \"dvi2tty * | cat -s\")) would tell \\[tex-view] to use xdvi under X windows and to use dvi2tty otherwise.") (defvar tex-show-queue-command "lpq" "\ *Command used by \\[tex-show-print-queue] to show the print queue. Should show the queue(s) that \\[tex-print] puts jobs on.") (defvar tex-default-mode (quote plain-tex-mode) "\ *Mode to enter for a new file that might be either TeX or LaTeX. This variable is used when it can't be determined whether the file is plain TeX or LaTeX or what because the file contains no commands. Normally set to either `plain-tex-mode' or `latex-mode'.") (defvar tex-open-quote "``" "\ *String inserted by typing \\[tex-insert-quote] to open a quotation.") (defvar tex-close-quote "''" "\ *String inserted by typing \\[tex-insert-quote] to close a quotation.") (defvar tex-last-temp-file nil "\ Latest temporary file generated by \\[tex-region] and \\[tex-buffer]. Deleted when the \\[tex-region] or \\[tex-buffer] is next run, or when the tex shell terminates.") (defvar tex-command nil "\ Command to run TeX. The name of the file, preceded by a blank, will be added to this string.") (defvar tex-trailer nil "\ String appended after the end of a region sent to TeX by \\[tex-region].") (defvar tex-start-of-header nil "\ String used by \\[tex-region] to delimit the start of the file's header.") (defvar tex-end-of-header nil "\ String used by \\[tex-region] to delimit the end of the file's header.") (defvar tex-shell-cd-command "cd" "\ Command to give to shell running TeX to change directory. The value of `tex-directory' is appended to this, separated by a space.") (defvar tex-zap-file nil "\ Temporary file name used for text being sent as input to TeX. Should be a simple file name with no extension or directory specification.") (defvar tex-last-buffer-texed nil "\ Buffer which was last TeXed.") (defvar tex-print-file nil "\ File name that \\[tex-print] prints. Set by \\[tex-region], \\[tex-buffer], and \\[tex-file].") (defvar tex-mode-syntax-table nil "\ Syntax table used while in TeX mode.") (defalias 'tex-define-common-keys #[(keymap) " # # # # # !B# # # # # # #" [define-key keymap " " tex-kill-job "\f" tex-recenter-output-buffer "" tex-show-print-queue "" tex-print "" tex-view [menu-bar tex] "TeX" make-sparse-keymap [menu-bar tex tex-kill-job] ("Tex Kill" . tex-kill-job) [menu-bar tex tex-recenter-output-buffer] ("Tex Recenter" . tex-recenter-output-buffer) [menu-bar tex tex-show-print-queue] ("Show Print Queue" . tex-show-print-queue) [menu-bar tex tex-alt-print] ("Tex Print (alt printer)" . tex-alt-print) [menu-bar tex tex-print] ("Tex Print" . tex-print) [menu-bar tex tex-view] ("Tex View" . tex-view)] 6 "\ Define the keys that we want defined both in TeX mode and in the TeX shell."]) (defvar tex-mode-map nil "\ Keymap for TeX mode.") (byte-code "k !#######################" [tex-mode-map make-sparse-keymap tex-define-common-keys define-key "\"" tex-insert-quote "\n" tex-terminate-paragraph "}" up-list "{" tex-insert-braces "" tex-region "" tex-buffer "" tex-file " " tex-bibtex-file "" tex-latex-block "" tex-close-latex-block "" tex-goto-last-unclosed-latex-block [menu-bar tex tex-validate-region] ("Validate Region" . tex-validate-region) [menu-bar tex validate-tex-buffer] ("Validate Buffer" . validate-tex-buffer) [menu-bar tex tex-region] ("Tex Region" . tex-region) [menu-bar tex tex-buffer] ("Tex Buffer" . tex-buffer) [menu-bar tex tex-file] ("Tex File" . tex-file) put menu-enable mark-active tex-validate-region tex-print (stringp tex-print-file) tex-alt-print (stringp tex-print-file) tex-view (stringp tex-print-file) tex-recenter-output-buffer (get-buffer "*tex-shell*") tex-kill-job (tex-shell-running)] 4) (defvar tex-shell-map nil "\ Keymap for the TeX shell. Inherits `comint-mode-map' with a few additions.") (byte-code "!‡" [boundp compare-windows-whitespace nil] 2) (defalias 'tex-mode #[nil "eb#'`y#*\n\nE E!C!?͂D΂D) O R +" [nil comment slash mode search-forward "\\" t search-end 0 "%" looking-at "documentstyle\\|documentclass" "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}" slitex-mode latex-mode plain-tex-mode tex-default-mode] 4 "\ Major mode for editing files of input for TeX, LaTeX, or SliTeX. Tries to determine (by looking at the beginning of the file) whether this file is for plain TeX, LaTeX, or SliTeX and calls `plain-tex-mode', `latex-mode', or `slitex-mode', respectively. If it cannot be determined, such as if there are no commands in the file, the value of `tex-default-mode' says which mode to use." nil]) (byte-code "\"\"" [defalias TeX-mode tex-mode LaTeX-mode latex-mode] 3) (defalias 'plain-tex-mode #[nil "  \n\f#" [tex-common-initialization "TeX" mode-name plain-tex-mode major-mode tex-run-command tex-command "%**start of header" tex-start-of-header "%**end of header" tex-end-of-header "\\bye\n" tex-trailer run-hooks text-mode-hook tex-mode-hook plain-tex-mode-hook] 4 "\ Major mode for editing files of input for plain TeX. Makes $ and } display the characters they match. Makes \" insert `` when it seems to be the beginning of a quotation, and '' when it appears to be the end; it inserts \" only after a \\. Use \\[tex-region] to run TeX on the current region, plus a \"header\" copied from the top of the file (containing macro definitions, etc.), running TeX under a special subshell. \\[tex-buffer] does the whole buffer. \\[tex-file] saves the buffer and then processes the file. \\[tex-print] prints the .dvi file made by any of these. \\[tex-view] previews the .dvi file made by any of these. \\[tex-bibtex-file] runs bibtex on the file of the current buffer. Use \\[validate-tex-buffer] to check buffer for paragraphs containing mismatched $'s or braces. Special commands: \\{tex-mode-map} Mode variables: tex-run-command Command string used by \\[tex-region] or \\[tex-buffer]. tex-directory Directory in which to create temporary files for TeX jobs run by \\[tex-region] or \\[tex-buffer]. tex-dvi-print-command Command string used by \\[tex-print] to print a .dvi file. tex-alt-dvi-print-command Alternative command string used by \\[tex-print] (when given a prefix argument) to print a .dvi file. tex-dvi-view-command Command string used by \\[tex-view] to preview a .dvi file. tex-show-queue-command Command string used by \\[tex-show-print-queue] to show the print queue that \\[tex-print] put your job on. Entering Plain-tex mode runs the hook `text-mode-hook', then the hook `tex-mode-hook', and finally the hook `plain-tex-mode-hook'. When the special subshell is initiated, the hook `tex-shell-hook' is run." nil]) (defalias (quote plain-TeX-mode) (quote plain-tex-mode)) (defalias 'latex-mode #[nil "  \n\f#" [tex-common-initialization "LaTeX" mode-name latex-mode major-mode latex-run-command tex-command "\\documentstyle" tex-start-of-header "\\begin{document}" tex-end-of-header "\\end{document}\n" tex-trailer "^[ ]*$\\|^[\f%]\\|^[ ]*\\$\\$\\|^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|^\\\\\\]\\|^\\\\chapter\\>\\|^\\\\section\\>\\|^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|^\\\\item\\>\\|^\\\\bibitem\\>\\|^\\\\newline\\>\\|^\\\\noindent\\>\\|^\\\\[a-z]*space\\>\\|^\\\\[a-z]*skip\\>\\|^\\\\newpage\\>\\|^\\\\[a-z]*page\\|^\\\\footnote\\>\\|^\\\\marginpar\\>\\|^\\\\parbox\\>\\|^\\\\caption\\>" paragraph-start "^[ ]*$\\|^[\f%]\\|^[ ]*\\$\\$[ ]*$\\|^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|^\\\\\\]\\|^\\\\chapter\\>\\|^\\\\section\\>\\|^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|^\\\\item[ ]*$\\|^\\\\bibitem[ ]*$\\|^\\\\newline[ ]*$\\|^\\\\noindent[ ]*$\\|^\\\\[a-z]*space[ ]*$\\|^\\\\[a-z]*skip[ ]*$\\|^\\\\newpage[ ]*$\\|^\\\\[a-z]*page[a-z]*[ ]*$\\|^\\\\footnote[ ]*$\\|^\\\\marginpar[ ]*$\\|^\\\\parbox[ ]*$\\|^\\\\caption[ ]*$" paragraph-separate run-hooks text-mode-hook tex-mode-hook latex-mode-hook] 4 "\ Major mode for editing files of input for LaTeX. Makes $ and } display the characters they match. Makes \" insert `` when it seems to be the beginning of a quotation, and '' when it appears to be the end; it inserts \" only after a \\. Use \\[tex-region] to run LaTeX on the current region, plus the preamble copied from the top of the file (containing \\documentstyle, etc.), running LaTeX under a special subshell. \\[tex-buffer] does the whole buffer. \\[tex-file] saves the buffer and then processes the file. \\[tex-print] prints the .dvi file made by any of these. \\[tex-view] previews the .dvi file made by any of these. \\[tex-bibtex-file] runs bibtex on the file of the current buffer. Use \\[validate-tex-buffer] to check buffer for paragraphs containing mismatched $'s or braces. Special commands: \\{tex-mode-map} Mode variables: latex-run-command Command string used by \\[tex-region] or \\[tex-buffer]. tex-directory Directory in which to create temporary files for LaTeX jobs run by \\[tex-region] or \\[tex-buffer]. tex-dvi-print-command Command string used by \\[tex-print] to print a .dvi file. tex-alt-dvi-print-command Alternative command string used by \\[tex-print] (when given a prefix argument) to print a .dvi file. tex-dvi-view-command Command string used by \\[tex-view] to preview a .dvi file. tex-show-queue-command 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 `tex-mode-hook', and finally `latex-mode-hook'. When the special subshell is initiated, `tex-shell-hook' is run." nil]) (defalias 'slitex-mode #[nil "  \n\f$" [tex-common-initialization "SliTeX" mode-name slitex-mode major-mode slitex-run-command tex-command "\\documentstyle{slides}" tex-start-of-header "\\begin{document}" tex-end-of-header "\\end{document}\n" tex-trailer "^[ ]*$\\|^[\f%]\\|^[ ]*\\$\\$\\|^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|^\\\\\\]\\|^\\\\chapter\\>\\|^\\\\section\\>\\|^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|^\\\\item\\>\\|^\\\\bibitem\\>\\|^\\\\newline\\>\\|^\\\\noindent\\>\\|^\\\\[a-z]*space\\>\\|^\\\\[a-z]*skip\\>\\|^\\\\newpage\\>\\|^\\\\[a-z]*page\\|^\\\\footnote\\>\\|^\\\\marginpar\\>\\|^\\\\parbox\\>\\|^\\\\caption\\>" paragraph-start "^[ ]*$\\|^[\f%]\\|^[ ]*\\$\\$[ ]*$\\|^\\\\begin\\>\\|^\\\\label\\>\\|^\\\\end\\>\\|^\\\\\\[\\|^\\\\\\]\\|^\\\\chapter\\>\\|^\\\\section\\>\\|^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|^\\\\item[ ]*$\\|^\\\\bibitem[ ]*$\\|^\\\\newline[ ]*$\\|^\\\\noindent[ ]*$\\|^\\\\[a-z]*space[ ]*$\\|^\\\\[a-z]*skip[ ]*$\\|^\\\\newpage[ ]*$\\|^\\\\[a-z]*page[a-z]*[ ]*$\\|^\\\\footnote[ ]*$\\|^\\\\marginpar[ ]*$\\|^\\\\parbox[ ]*$\\|^\\\\caption[ ]*$" paragraph-separate run-hooks text-mode-hook tex-mode-hook latex-mode-hook slitex-mode-hook] 5 "\ Major mode for editing files of input for SliTeX. Makes $ and } display the characters they match. Makes \" insert `` when it seems to be the beginning of a quotation, and '' when it appears to be the end; it inserts \" only after a \\. Use \\[tex-region] to run SliTeX on the current region, plus the preamble copied from the top of the file (containing \\documentstyle, etc.), running SliTeX under a special subshell. \\[tex-buffer] does the whole buffer. \\[tex-file] saves the buffer and then processes the file. \\[tex-print] prints the .dvi file made by any of these. \\[tex-view] previews the .dvi file made by any of these. \\[tex-bibtex-file] runs bibtex on the file of the current buffer. Use \\[validate-tex-buffer] to check buffer for paragraphs containing mismatched $'s or braces. Special commands: \\{tex-mode-map} Mode variables: slitex-run-command Command string used by \\[tex-region] or \\[tex-buffer]. tex-directory Directory in which to create temporary files for SliTeX jobs run by \\[tex-region] or \\[tex-buffer]. tex-dvi-print-command Command string used by \\[tex-print] to print a .dvi file. tex-alt-dvi-print-command Alternative command string used by \\[tex-print] (when given a prefix argument) to print a .dvi file. tex-dvi-view-command Command string used by \\[tex-view] to preview a .dvi file. tex-show-queue-command Command string used by \\[tex-show-print-queue] to show the print queue that \\[tex-print] put your job on. Entering SliTeX mode runs the hook `text-mode-hook', then the hook `tex-mode-hook', then the hook `latex-mode-hook', and finally the hook `slitex-mode-hook'. When the special subshell is initiated, the hook `tex-shell-hook' is run." nil]) (byte-code "\"\"\"" [defalias tex-common-initialization #[nil " \n!  r  !W-\"T\"\"\"\"\"\"\"\"\"\"\"\"\")v !!!!#!%!'!)!+!-!!!!" [kill-all-local-variables use-local-map tex-mode-map text-mode-abbrev-table local-abbrev-table tex-mode-syntax-table 0 char make-syntax-table set-syntax-table 32 modify-syntax-entry "." "w" 9 " " 10 ">" 12 36 "$$" 37 "<" 92 "/" 34 38 95 64 "_" 126 39 make-local-variable paragraph-start "^[ ]*$\\|^[\f\\\\%]\\|^[ ]*\\$\\$" paragraph-separate "^[ ]*$\\|^[\f\\\\%]\\|^[ ]*\\$\\$[ ]*$" comment-start "%" comment-start-skip "\\(\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)" comment-indent-function tex-comment-indent parse-sexp-ignore-comments t compare-windows-whitespace tex-categorize-whitespace tex-command tex-start-of-header tex-end-of-header tex-trailer] 4] tex-comment-indent #[nil "!ixnĂiT ]" [looking-at "%%%" " " nil 0 comment-column] 2] tex-categorize-whitespace #[(backward-limit) " x\nR!!ȕb =!> =5͉ ȕb!L͉ ͉\fw =`ɂa *" [null t not-finished category " \n\f" backward-limit looking-at "[ ]+" 0 space "\n" newline par nil "\f+"] 3]] 3) (defalias 'tex-insert-quote #[(arg) "\n!!ou!)*hU(Ȃ* c" [arg self-insert-command prefix-numeric-value -1 looking-at "\\s(\\|\\s \\|\\s>" tex-open-quote 92 34 tex-close-quote] 3 "\ Insert the appropriate quote marks for TeX. Inserts the value of `tex-open-quote' (normally ``) or `tex-close-quote' (normally '') depending on the context. With prefix argument, always inserts \" characters." "*P"]) (defalias 'validate-tex-buffer #[nil "peĐ!q   \f)db o`#`\"y`)y` ^ \n`\"Ze\"T` qeby\fB\f #Zu \"c,)\")q\fct\fG\")+" [nil linenum prevpos buffer "*Occur*" princ "Mismatches:\n" standard-output occur-mode occur-buffer 0 occur-nlines occur-pos-list input-pending-p end search-backward "\n\n" move tex-validate-region 1 start tem count-lines point-marker insert-buffer-substring format "%3d: " "None!\n" message "%d mismatches found"] 5 "\ Check current buffer for paragraphs containing mismatched $s. Their positions are recorded in the buffer `*Occur*'. To find a particular invalidity from `*Occur*', switch to to that buffer and type C-c C-c on the line for the invalidity you want to see." nil]) (defalias 'tex-validate-region #[(start end) " \nZƏ)\f\fb*" [nil end start max-possible-sexps failure-point (byte-code " }b SW!)‡" [start end 0 max-possible-sexps forward-sexp 1] 3) ((error (byte-code "`" [failure-point nil] 1))) t] 3 "\ Check for mismatched braces or $'s in region. Returns t if no mismatches. Returns nil and moves point to suspect area if a mismatch is found." "r"]) (defalias 'tex-terminate-paragraph #[(inhibit-validation) "#`)`\")!c" [inhibit-validation tex-validate-region search-backward "\n\n" nil move message "Paragraph being closed appears to contain a mismatch"] 5 "\ Insert two newlines, breaking a paragraph for TeX. Check for mismatched braces or $s in paragraph being terminated. A prefix arg inhibits the checking." "*P"]) (defalias 'tex-insert-braces #[nil "cc)" [123 125] 1 "\ Make a pair of braces and be poised to type inside of them." "*"]) (defalias 'tex-latex-block #[(name) "i \"cjcj \"!mc*" [col format "\\begin{%s}\n" name 10 insert-string "\\end{%s}"] 4 "\ Creates a matching pair of lines `\\begin{NAME}' and `\\end{NAME}' at point. Puts point on a blank line between them." (byte-code " \"\"\"C" [barf-if-buffer-read-only completing-read "LaTeX block name: " mapcar list append standard-latex-block-names latex-block-names] 7)]) (defalias 'tex-last-unended-begin #[nil "!! " [re-search-backward "\\(\\\\begin\\s *{\\)\\|\\(\\\\end\\s *{\\)" looking-at "\\\\end{" tex-last-unended-begin] 2 "\ Leave point at the beginning of the last `\\begin{...}' that is unended."]) (defalias 'tex-goto-last-unclosed-latex-block #[nil "Ï`) b)" [nil spot (tex-last-unended-begin) ((error (error "Couldn't find unended \\begin"))) push-mark] 3 "\ Move point to the last unclosed \\begin{...}. Mark is left at original location." nil]) (defalias 'tex-close-latex-block #[nil "nŏi!Ȕȕ{) j\n 'c+" [nil indentation text new-line-needed (tex-last-unended-begin) ((error (error "Couldn't find unended \\begin"))) re-search-forward "\\\\begin\\(\\s *{[^}\n]*}\\)" 1 "\\end" 10] 3 "\ Creates an \\end{...} to match the last unclosed \\begin{...}." "*"]) (defalias 'tex-compilation-parse-errors #[nil "!\"\"\"\"\n \f bo.y#y`\\bp!c u  k\nUx !   !!\f\n\f\fq\nUb\n\nZy\n D B)y,.d +! " [nil compilation-error-list message "Parsing error messages..." modify-syntax-entry 123 "_" 125 91 93 last-linenum last-filename text-buffer compilation-parsing-end 2 re-search-forward "^l.[0-9]+ " t text-marker error-marker filename linenum 0 read 41 backward-sexp current-word "^(" backward-char forward-sexp backward-delete-char 1 point-marker file-exists-p find-file-noselect "Parsing error messages...done"] 5 "\ Parse the current buffer as error messages. This makes a list of error descriptors, compilation-error-list. For each source-file, line-number pair in the buffer, the source file is read in, and the text location is saved in compilation-error-list. The function `next-error', assigned to \\[next-error], takes the next error off the list and visits its location. This function works on TeX compilations only. It is necessary for that purpose, since TeX does not put file names on the same line as line numbers for the errors."]) (byte-code "\"\"" [defalias tex-start-shell #[nil "\n!!#q!  \" !!!!! UJ!<*" [make-comint "tex-shell" tex-shell-file-name getenv "ESHELL" "SHELL" "/bin/sh" nil get-process proc set-process-sentinel tex-shell-sentinel process-kill-without-query copy-keymap shell-mode-map tex-shell-map tex-define-common-keys use-local-map run-hooks tex-shell-hook buffer-size 0 sleep-for 1] 4] tex-shell-sentinel #[(proc msg) "\n!!\n\" \n!> " [buffer-name process-buffer proc set-process-buffer nil tex-delete-last-temp-files process-status (signal exit)] 3]] 3) (defalias 'tex-set-buffer-directory #[(buffer directory) "\n!!\n!\n\"q\n)" [file-name-as-directory expand-file-name directory file-directory-p error "%s is not a directory" buffer default-directory] 3 "\ Set BUFFER's default directory to be DIRECTORY."]) (byte-code "!!" [boundp tex-send-command-modified-tick 0 make-variable-buffer-local] 2) (defalias 'tex-send-command #[(command &optional file background) " !! !\n\"\n 7\n/\n\nO \n\nTOQ8\n Q8\nAЂBPq!UW ! !bc !." [eval command cmd get-process "tex-shell" proc process-buffer buf string-match "\\*" star file 0 nil " " background "&" "" string buffer-modified-tick tex-send-command-modified-tick accept-process-output process-mark comint-send-input] 5 "\ Send COMMAND to TeX shell process, substituting optional FILE for *. Do this in background if optional BACKGROUND is t. If COMMAND has no *, FILE will be appended, preceded by a blank, to COMMAND. If FILE is nil, no substitution will be made in COMMAND. COMMAND can be any expression that evaluates to a command string."]) (defalias 'tex-delete-last-temp-files #[(&optional not-all) "F!\n!!\n\"E3@\";\n@P!;\n@P!A*" [tex-last-temp-file file-name-directory dir file-directory-p file-name-all-completions file-name-nondirectory list not-all string-match "\\.dvi$" delete-file nil] 4 "\ Delete any junk files from last temp file. If NOT-ALL is non-nil, save the `.dvi' file."]) (add-hook (quote kill-emacs-hook) (quote tex-delete-last-temp-files)) (defalias 'tex-region #[(beg end) "  !!! ! !!P!~eby`eeeb#uy`#ry`ue^P܉%]!P%,\"# q !##! \"edP%+(*\"+\",p-+" [tex-shell-running tex-kill-job tex-start-shell display-buffer process-buffer get-process "tex-shell" tex-zap-file tex-generate-zap-file-name get-buffer-create " TeX-Output-Buffer" temp-buffer file-name-as-directory expand-file-name tex-directory zap-directory tex-out-file tex-delete-last-temp-files t 100 default-directory hend hbeg search-end search-forward tex-start-of-header 0 tex-end-of-header nil 1 write-region beg ".tex" end tex-trailer local-tex-trailer erase-buffer insert-string "\n" tex-set-buffer-directory tex-last-temp-file tex-send-command tex-shell-cd-command tex-command tex-print-file tex-last-buffer-texed] 7 "\ Run TeX on the current region, via a temporary file. The file's name comes from the variable `tex-zap-file' and the variable `tex-directory' says where to put it. If the buffer has a header, the header is given to TeX before the region itself. The buffer's header is all lines between the strings defined by `tex-start-of-header' and `tex-end-of-header' inclusive. The header must start in the first 100 lines of the buffer. The value of `tex-trailer' is given to TeX as input after the region. The value of `tex-command' specifies the command to use to run TeX." "r"]) (defalias 'tex-buffer #[nil "ed\"" [tex-region] 3 "\ Run TeX on current buffer. See \\[tex-region] for more information. Does not save the buffer, so it's useful for trying experimental versions. See \\[tex-file] for an alternative." nil]) (defalias 'tex-file #[nil " \f !! ! ) , !!! \"\"*p " [buffer-file-name file-name-nondirectory error "Buffer does not seem to be associated with any file" file-name-directory file-dir tex-out-file tex-offer-save save-some-buffers tex-shell-running tex-kill-job tex-start-shell display-buffer process-buffer get-process "tex-shell" tex-send-command tex-shell-cd-command tex-command tex-last-buffer-texed tex-print-file] 4 "\ Prompt to save all buffers and run TeX (or LaTeX) on current buffer's file. This function is more useful than \\[tex-buffer] when you need the `.aux' file of LaTeX to have the correct name." nil]) (defalias 'tex-generate-zap-file-name #[nil "!! !#" [format "#tz%d%s" process-id get-buffer-process "*tex-shell*" tex-strip-dots system-name] 5 "\ Generate a unique name suitable for use as a file name."]) (byte-code "\"\"\"" [defalias tex-strip-dots #[(s) " ! \" ĔI " [copy-sequence s string-match "\\." 0 45] 3] tex-expand-files #[(s) "\n#\nO B\nU*\nO B #*" [nil 0 start elts string-match ":" s mapconcat expand-file-name] 4] tex-shell-running #[nil "! !!=" [get-process "tex-shell" process-status run] 3]] 3) (defalias 'tex-kill-job #[nil "!\"" [quit-process get-process "tex-shell" t] 3 "\ Kill the currently running TeX job." nil]) (defalias 'tex-recenter-output-buffer #[(linenum) "!p!1 ! !db ( !, ̥!\n!*" [get-buffer "*tex-shell*" old-buffer tex-shell message "No TeX output buffer" pop-to-buffer bury-buffer recenter linenum prefix-numeric-value window-height 2] 4 "\ Redisplay buffer of TeX job output so that most recent output can be seen. The last line of the buffer is displayed on line LINE of the window, or centered if LINE is nil." "P"]) (defalias 'tex-print #[(&optional alt) " \"p \" \"\f !)!9 46 #*" [tex-append tex-print-file ".dvi" nil test-name print-file-name-dvi tex-last-buffer-texed file-newer-than-file-p buffer-file-name file-exists-p error "No appropriate `.dvi' file could be found" tex-send-command alt tex-alt-dvi-print-command tex-dvi-print-command t] 4 "\ Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. Runs the shell command defined by `tex-dvi-print-command'. If prefix argument is provided, use the alternative command, `tex-alt-dvi-print-command'." "P"]) (defalias 'tex-alt-print #[nil "!" [tex-print t] 2 "\ Print the .dvi file made by \\[tex-region], \\[tex-buffer] or \\[tex-file]. Runs the shell command defined by tex-alt-dvi-print-command." nil]) (defalias 'tex-view #[nil " )" [tex-dvi-view-command tex-dvi-print-command tex-print] 1 "\ Preview the last `.dvi' file made by running TeX under Emacs. This means, made using \\[tex-region], \\[tex-buffer] or \\[tex-file]. The variable `tex-dvi-view-command' specifies the shell command for preview." nil]) (defalias 'tex-append #[(file-name suffix) ";:!!\f\f\"O Q !' P!+ 8!\f\f\"O Q*͇" [file-name file-name-nondirectory nil trial-name file file-name-directory 0 string-match "\\." suffix file-exists-p ".aux" "\\.[^.]*$" " "] 6 "\ Append to FILENAME the suffix SUFFIX, using same algorithm TeX uses. Pascal-based TeX scans for the first period, C TeX uses the last. No period is retained immediately before SUFFIX, so normally SUFFIX starts with one."]) (defalias 'tex-show-print-queue #[nil "  !!!!" [tex-shell-running tex-kill-job tex-start-shell display-buffer process-buffer get-process "tex-shell" tex-send-command tex-show-queue-command] 4 "\ Show the print queue that \\[tex-print] put your job on. Runs the shell command defined by `tex-show-queue-command'." nil]) (defalias 'tex-bibtex-file #[nil "  !!! !\" !\f \f\" \"*" [tex-shell-running tex-kill-job tex-start-shell display-buffer process-buffer get-process "tex-shell" tex-append file-name-nondirectory buffer-file-name "" file-name-directory file-dir tex-out-file tex-send-command tex-shell-cd-command tex-bibtex-command] 4 "\ Run BibTeX on the current buffer's file." nil]) (byte-code "!!" [run-hooks tex-mode-load-hook provide tex-mode] 2)