home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / useful / lib / emacs / 18.59 / lisp / tex-mode.elc < prev    next >
Text File  |  1991-01-09  |  12KB  |  211 lines

  1.  
  2. (provide (quote tex-mode))
  3.  
  4. (defvar TeX-directory "/tmp/" "\
  5. *Directory in which to run TeX subjob.  Temporary files are
  6. created in this directory.")
  7.  
  8. (defvar TeX-dvi-print-command "lpr -d" "\
  9. *Command string used by \\[TeX-print] to print a .dvi file.")
  10.  
  11. (defvar TeX-show-queue-command "lpq" "\
  12. *Command string used by \\[TeX-show-print-queue] to show the print queue
  13. that \\[TeX-print] put your job on.")
  14.  
  15. (defvar TeX-default-mode (quote plain-TeX-mode) "\
  16. *Mode to enter for a new file when it can't be determined whether
  17. the file is plain TeX or LaTeX or what.")
  18.  
  19. (defvar TeX-command nil "\
  20. The command to run TeX on a file.  The name of the file will be appended
  21. to this string, separated by a space.")
  22.  
  23. (defvar TeX-trailer nil "\
  24. String appended after the end of a region sent to TeX by \\[TeX-region].")
  25.  
  26. (defvar TeX-start-of-header nil "\
  27. String used by \\[TeX-region] to delimit the start of the file's header.")
  28.  
  29. (defvar TeX-end-of-header nil "\
  30. String used by \\[TeX-region] to delimit the end of the file's header.")
  31.  
  32. (defvar TeX-shell-cd-command "cd" "\
  33. Command to give to shell running TeX to change directory.  The value of
  34. TeX-directory will be appended to this, separated by a space.")
  35.  
  36. (defvar TeX-zap-file nil "\
  37. Temporary file name used for text being sent as input to TeX.
  38. Should be a simple file name with no extension or directory specification.")
  39.  
  40. (defvar TeX-mode-syntax-table nil "\
  41. Syntax table used while in TeX mode.")
  42.  
  43. (defun TeX-define-common-keys (keymap) "\
  44. Define the keys that we want defined both in TeX-mode
  45. and in the TeX-shell." (byte-code "ÁÂÃ#ˆÁÄÅ#ˆÁÆÇ#ˆÁÈÉ#‡" [keymap define-key " " TeX-kill-job " " TeX-recenter-output-buffer "" TeX-show-print-queue "" TeX-print] 7))
  46.  
  47. (defvar TeX-mode-map nil "\
  48. Keymap for TeX mode")
  49.  
  50. (if TeX-mode-map nil (setq TeX-mode-map (make-sparse-keymap)) (TeX-define-common-keys TeX-mode-map) (define-key TeX-mode-map "\"" (quote TeX-insert-quote)) (define-key TeX-mode-map "
  51. " (quote TeX-terminate-paragraph)) (define-key TeX-mode-map "}" (quote up-list)) (define-key TeX-mode-map "{" (quote TeX-insert-braces)) (define-key TeX-mode-map "" (quote TeX-region)) (define-key TeX-mode-map "" (quote TeX-buffer)) (define-key TeX-mode-map "" (quote TeX-close-LaTeX-block)))
  52.  
  53. (defvar TeX-shell-map nil "\
  54. Keymap for the TeX shell.  A shell-mode-map with a few additions")
  55.  
  56. (defun tex-mode nil "\
  57. Major mode for editing files of input for TeX or LaTeX.
  58. Trys to intuit whether this file is for plain TeX or LaTeX and
  59. calls plain-tex-mode or latex-mode.  If it cannot be determined
  60. (e.g., there are no commands in the file), the value of
  61. TeX-default-mode is used." (interactive) (byte-code "ÈÃÃÊebˆÇÈÃÄ#‰…%`ŠÉ ˆÇÊÄ#))‰…-Ȃ ˆ    …4
  62. ?…DËÌ!ƒA͂BΉ)ˆƒPÏ!‚TÏ!+‡" [mode slash comment nil t search-end TeX-default-mode search-forward "\\" beginning-of-line "%" looking-at "documentstyle" latex-mode plain-tex-mode funcall] 7))
  63.  
  64. (fset (quote plain-TeX-mode) (quote plain-tex-mode))
  65.  
  66. (fset (quote LaTeX-mode) (quote latex-mode))
  67.  
  68. (defun plain-tex-mode nil "\
  69. Major mode for editing files of input for plain TeX.
  70. Makes $ and } display the characters they match.
  71. Makes \" insert `` when it seems to be the beginning of a quotation,
  72. and '' when it appears to be the end; it inserts \" only after a \\.
  73.  
  74. Use \\[TeX-region] to run TeX on the current region, plus a \"header\"
  75. copied from the top of the file (containing macro definitions, etc.),
  76. running TeX under a special subshell.  \\[TeX-buffer] does the whole buffer.
  77. \\[TeX-print] prints the .dvi file made by either of these.
  78.  
  79. Use \\[validate-TeX-buffer] to check buffer for paragraphs containing
  80. mismatched $'s or braces.
  81.  
  82. Special commands:
  83. \\{TeX-mode-map}
  84.  
  85. Mode variables:
  86. TeX-directory
  87.     Directory in which to create temporary files for TeX jobs
  88.     run by \\[TeX-region] or \\[TeX-buffer].
  89. TeX-dvi-print-command
  90.     Command string used by \\[TeX-print] to print a .dvi file.
  91. TeX-show-queue-command
  92.     Command string used by \\[TeX-show-print-queue] to show the print
  93.     queue that \\[TeX-print] put your job on.
  94.  
  95. Entering plain-TeX mode calls the value of text-mode-hook,
  96. then the value of TeX-mode-hook, and then the value
  97. of plain-TeX-mode-hook." (interactive) (byte-code "ƈǠˆÈ‰ˆÉ‰ˆÊ‰ˆË‰ˆÌ‰ˆÍ‰ˆÎÏÐÑ#‡" [mode-name major-mode TeX-command TeX-start-of-header TeX-end-of-header TeX-trailer nil TeX-common-initialization "TeX" plain-TeX-mode "tex" "%**start of header" "%**end of header" "\\bye
  98. " run-hooks text-mode-hook TeX-mode-hook plain-TeX-mode-hook] 5))
  99.  
  100. (defun latex-mode nil "\
  101. Major mode for editing files of input for LaTeX.
  102. Makes $ and } display the characters they match.
  103. Makes \" insert `` when it seems to be the beginning of a quotation,
  104. and '' when it appears to be the end; it inserts \" only after a \\.
  105.  
  106. Use \\[TeX-region] to run LaTeX on the current region, plus the preamble
  107. copied from the top of the file (containing \\documentstyle, etc.),
  108. running LaTeX under a special subshell.  \\[TeX-buffer] does the whole buffer.
  109. \\[TeX-print] prints the .dvi file made by either of these.
  110.  
  111. Use \\[validate-TeX-buffer] to check buffer for paragraphs containing
  112. mismatched $'s or braces.
  113.  
  114. Special commands:
  115. \\{TeX-mode-map}
  116.  
  117. Mode variables:
  118. TeX-directory
  119.     Directory in which to create temporary files for TeX jobs
  120.     run by \\[TeX-region] or \\[TeX-buffer].
  121. TeX-dvi-print-command
  122.     Command string used by \\[TeX-print] to print a .dvi file.
  123. TeX-show-queue-command
  124.     Command string used by \\[TeX-show-print-queue] to show the print
  125.     queue that \\[TeX-print] put your job on.
  126.  
  127. Entering LaTeX mode calls the value of text-mode-hook,
  128. then the value of TeX-mode-hook, and then the value
  129. of LaTeX-mode-hook." (interactive) (byte-code "ƈǠˆÈ‰ˆÉ‰ˆÊ‰ˆË‰ˆÌ‰ˆÍ‰ˆÎÏÐÑ#‡" [mode-name major-mode TeX-command TeX-start-of-header TeX-end-of-header TeX-trailer nil TeX-common-initialization "LaTeX" LaTeX-mode "latex" "\\documentstyle" "\\begin{document}" "\\end{document}
  130. " run-hooks text-mode-hook TeX-mode-hook LaTeX-mode-hook] 5))
  131.  
  132. (defun TeX-common-initialization nil (byte-code "É ˆÊ!ˆ
  133. ‰ˆ ?ƒRË ‰ˆÌ !ˆÍÎÏ\"ˆÍÐÑ\"ˆÍÒÑ\"ˆÍÓÔ\"ˆÍÕÖ\"ˆÍ×Ï\"ˆÍØÏ\"ˆÍÙÏ\"ˆÍÚÛ\"ˆÍÜÝ\"ˆÍÞß\"‚UÌ !ˆàÄ!ˆá‰ˆàÅ!ˆ ‰ˆàÆ!ˆâ‰ˆàÇ!ˆã‰ˆàÈ!ˆä‰ˆàå!ˆàæ!ˆàç!ˆàè!‡" [TeX-mode-map local-abbrev-table text-mode-abbrev-table TeX-mode-syntax-table paragraph-start paragraph-separate comment-start comment-start-skip comment-indent-hook kill-all-local-variables use-local-map make-syntax-table set-syntax-table modify-syntax-entry 92 "." 12 ">" 10 36 "$$" 37 "<" 34 38 95 64 "_" 126 " " 39 "w" make-local-variable "^[     ]*$\\|^[ \\\\%]" "%" "\\(\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)" TeX-comment-indent TeX-command TeX-start-of-header TeX-end-of-header TeX-trailer] 26))
  134.  
  135. (defun TeX-comment-indent nil (byte-code "ÁÂ!ƒ
  136. i‚ÃÄ!ˆnƒłiT]‡" [comment-column looking-at "%%%" skip-chars-backward "     " 0] 4))
  137.  
  138. (defun TeX-insert-quote (arg) "\
  139. Insert ``, '' or \" according to preceding character.
  140. With prefix argument, always insert \" characters." (interactive "P") (byte-code "ȃÄ!<ƒÅÆ!‚Å    !)‚<o†)ŠÇÈ!ˆÉÊ!)ƒ0˂;hÌUƒ:͂;Îc‡" [arg count t nil prefix-numeric-value self-insert-command 1 forward-char -1 looking-at "[     
  141. ]\\|\\s(" "``" 92 34 "''"] 7))
  142.  
  143. (defun validate-TeX-buffer nil "\
  144. Check current buffer for paragraphs containing mismatched $'s.
  145. As each such paragraph is found, a mark is pushed at its beginning,
  146. and the location is displayed for a few seconds." (interactive) (byte-code "ˆ`dbˆÃŽÄ ?…o?…3`ÅÆÂÇ#ˆÈ`    \"†.É`!ˆÊË!ˆÌÍ!)ˆ‚    ))‡" [opoint end nil ((byte-code "b‡" [opoint] 1)) input-pending-p search-backward "
  147.  
  148. " move TeX-validate-paragraph push-mark message "Mismatch found in pararaph starting here" sit-for 4] 8))
  149.  
  150. (defun TeX-validate-paragraph (start end) (byte-code "ÀÁ‡" [nil (byte-code "ŠŒÃ    \"ˆbˆÄ    Z!ˆÂ))‡" [start end t narrow-to-region forward-sexp] 4) ((error (byte-code "À‡" [nil] 1)))] 3))
  151.  
  152. (defun TeX-terminate-paragraph (inhibit-validation) "\
  153. Insert two newlines, breaking a paragraph for TeX.
  154. Check for mismatched braces/$'s in paragraph being terminated.
  155. A prefix arg inhibits the checking." (interactive "P") (byte-code "Áˆ†ŠÃÄÁÅ#ˆ`)`\"†ÆÇ!ˆÄc‡" [inhibit-validation nil TeX-validate-paragraph search-backward "
  156.