home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / docs.lha / latexinfo / elisp / latexnfo-tex.elc < prev    next >
Encoding:
Text File  |  1992-02-26  |  7.5 KB  |  118 lines

  1.  
  2. (require (quote shell))
  3.  
  4. (defvar latexinfo-latex-shell-cd-command "cd" "\
  5. Command to give to shell running LaTeX to change directory.")
  6.  
  7. (defvar latexinfo-latex-command "latex" "\
  8. *Command used by  latexinfo-latex-region  to run LaTeX on a region.")
  9.  
  10. (defvar latexinfo-latexindex-command "latexindex" "\
  11. *Command used by  latexinfo-latexindex  to sort unsorted index files.")
  12.  
  13. (defvar latexinfo-latex-dvi-print-command "lpr -d" "\
  14. *Command string used by \\[tex-print] to print a .dvi file.")
  15.  
  16. (defvar latexinfo-show-latex-queue-command "lpq" "\
  17. *Command string used to show the Latexinfo LaTeX print queue.
  18. Command is used by \\[latexinfo-show-latex-print-queue] and it
  19. should show the queue that \\[latexinfo-latex-print] puts jobs on.")
  20.  
  21. (defvar latexinfo-delete-from-print-queue-command "lprm" "\
  22. *Command string used to delete a job from the line printer queue.
  23. Command is used by \\[latexinfo-delete-from-latex-print-queue] based on
  24. number provided by a previous \\[latexinfo-show-latex-print-queue]
  25. command.")
  26.  
  27. (defvar latexinfo-latex-trailer "\\end{document}" "\
  28. String appended after a region sent to LaTeX by latexinfo-latex-region.")
  29.  
  30. (defvar latexinfo-latex-original-file "" "\
  31. Original name of file on which to run LaTeX.")
  32.  
  33. (defvar latexinfo-latex-temp-file nil "\
  34. Temporary file name used for text being sent as input to LaTeX.")
  35.  
  36. (defvar latexinfo-latex-root-temp-file nil "\
  37. Temporary file name used for text being sent as input to LaTeX.")
  38.  
  39. (defun latexinfo-latex-region (beginning end) "\
  40. Run LaTeX on the current region. 
  41.  
  42. A temporary file is written in the default directory, and LaTeX is run
  43. in that directory.  The first line of the file is copied to the
  44. temporary file; and if the buffer has a header, it is written to the
  45. temporary file before the region itself.  The buffer's header is all
  46. lines between the strings defined by latexinfo-start-of-header and
  47. latexinfo-end-of-header inclusive.  The header must start in the first 100
  48. lines.  The value of latexinfo-latex-trailer is appended to the temporary file
  49. after the region." (interactive "r") (byte-code "╞ê╤╥!â╙╘╒!└\"é╓ ê╫╪┘┌█ !!!!ëê    ▄Pèî▌ êebê▐▀!ê`eeebêα`è▐ß!ê`)
  50. ╞╞%ê▐ß!ê`WàW`ëêΓ └#à~π ê`ëêΓ    ╞└#â{▐ß!ê`ëé~eëêα ^
  51. └╞%êα
  52. ]
  53.  
  54. └╞%ê Σσ!
  55.  
  56. qêµ êτΦ!ê à▓ cêαed
  57. └╞%*+êΘ╘╒!Ω\"êδ╒∞ΦR\"êδ╒∞
  58. ΦR\"êφε!)))ç" [t latexinfo-latex-root-temp-file latexinfo-latex-temp-file search-end header-beginning header-end nil beginning latexinfo-start-of-header latexinfo-end-of-header end local-latex-trailer latexinfo-latex-trailer temp-buffer latexinfo-latex-shell-cd-command default-directory latexinfo-latex-command get-buffer "*latexinfo-latex-shell*" quit-process get-process "latexinfo-latex-shell" latexinfo-latex-start-shell expand-file-name make-temp-name prin1-to-string read buffer-name ".tex" widen forward-line 100 write-region 1 search-forward beginning-of-line get-buffer-create " latexinfo-trailer-buffer" erase-buffer insert-string "
  59. " set-process-sentinel latexinfo-latex-shell-sentinel send-string " " latexinfo-recenter-latex-output-buffer 0] 33))
  60.  
  61. (defun latexinfo-latex-buffer (buffer) "\
  62. Run LaTeX on current buffer.
  63. After running LaTeX the first time, you may have to run \\[latexinfo-latexindex]
  64. and then \\[latexinfo-latex-buffer] again." (interactive (byte-code "┬├p!─\"à
  65. â┼╞╟!    \"é┼╞╟!├p!\"Cç" [latexinfo-latex-root-temp-file latexinfo-latex-original-file string= buffer-name "*latexinfo-latex-shell*" read-string format "Run LaTeX on: "] 9)) (byte-code "╟ê╚╔p!╩\"â
  66. qé╔p!ëê╦╩!â%╠═╬!├\"é'╧ ê ?â3╨╤!ép╥ â>╨╙!ép╘═╬!╒\"ê╓╬
  67. ╫╪─╦
  68. !!!┘R\"ê╓╬╫
  69. ┘R\"ê
  70. ┌█▄
  71. \"åi
  72. GOëê▌┌!ç" [latexinfo-latex-root-temp-file latexinfo-latex-original-file buffer t buffer-file-name latexinfo-latex-shell-cd-command latexinfo-latex-command nil string= buffer-name "*latexinfo-latex-shell*" get-buffer quit-process get-process "latexinfo-latex-shell" latexinfo-latex-start-shell error "Buffer not visiting any file!" buffer-modified-p "Buffer has been modified since last saved!" set-process-sentinel latexinfo-latex-shell-sentinel send-string " " file-name-directory "
  73. " 0 string-match "\\.tex" latexinfo-recenter-latex-output-buffer] 22))
  74.  
  75. (defun latexinfo-latexindex nil "\
  76. Run latexindex on unsorted index files.
  77. The index files are made by \\[latexinfo-latex-region] or \\[latexinfo-latex-buffer].
  78. Runs the shell command defined by latexinfo-latexindex-command." (interactive) (byte-code "┬ê├─┼╞    ╟╚%\"ê╔┬!ç" [latexinfo-latexindex-command latexinfo-latex-root-temp-file nil send-string "latexinfo-latex-shell" concat " " ".??" "
  79. " latexinfo-recenter-latex-output-buffer] 8))
  80.  
  81. (defun latexinfo-latex-print nil "\
  82. Print .dvi file made by \\[latexinfo-latex-region] or \\[latexinfo-latex-buffer].
  83. Runs the shell command defined by latexinfo-latex-dvi-print-command." (interactive) (byte-code "┬ê├─┼╞    ╟╚%\"ê╔┬!ç" [latexinfo-latex-dvi-print-command latexinfo-latex-root-temp-file nil send-string "latexinfo-latex-shell" concat " " ".dvi" "
  84. " latexinfo-recenter-latex-output-buffer] 8))
  85.  
  86. (defun latexinfo-latex-start-shell nil (byte-code "è├─!?à ┼╞!ê╟╚╔└╩$qê╦
  87. !ëê╠    !ê═    !ê╬╧!ê╨╤ !à0╥╙!)ç" [nil latexinfo-latex-shell-map shell-mode-map fboundp latexinfo-mode load "latexnfo-mde" make-shell "latexinfo-latex-shell" "/bin/sh" "-v" copy-keymap latexinfo-define-common-keys use-local-map run-hooks latexinfo-latex-shell-hook zerop buffer-size sleep-for 1] 11))
  88.  
  89. (defun latexinfo-quit-latex-job nil "\
  90. Quit currently running LaTeX job, by sending an `x' to it." (interactive) (byte-code "└ê┴┬!?à ├─!êè┼╞!qêdbê╟cê╚ )ç" [nil get-process "latexinfo-latex-shell" error "No LaTeX shell running." get-buffer "*latexinfo-latex-shell*" "x" shell-send-input] 5))
  91.  
  92. (defun latexinfo-kill-latex-job nil "\
  93. Kill the currently running LaTeX job." (interactive) (byte-code "└ê┴┬!à
  94. ├┴┬!!ç" [nil get-process "latexinfo-latex-shell" kill-process] 4))
  95.  
  96. (defun latexinfo-latex-shell-sentinel (process event) "\
  97. Restart latexinfo-latex-shell after it is killed." (byte-code "┴┬\"àè├qê─cê┼ )ç" [event equal "killed
  98. " "*latexinfo-latex-shell*" "
  99. " latexinfo-latex-start-shell] 3))
  100.  
  101. (defun latexinfo-recenter-latex-output-buffer (linenum) "\
  102. Redisplay buffer of LaTeX job output so that most recent output can be seen.
  103. The last line of the buffer is displayed on
  104. line LINE of the window, or centered if LINE is nil." (interactive "P") (byte-code "├ê─┼!p?â╞╟!é3╚!ê╔!êdbê╩
  105. â)╦
  106. !é.╠═ ╬\"!ê╚    !*ç" [latexinfo-latex-shell old-buffer linenum nil get-buffer "*latexinfo-latex-shell*" message "No LaTeX output buffer" pop-to-buffer bury-buffer recenter prefix-numeric-value / window-height 2] 10))
  107.  
  108. (defun latexinfo-show-latex-print-queue nil "\
  109. Show the print queue that \\[latexinfo-latex-print] put your job on.
  110. Runs the shell command defined by latexinfo-show-latex-queue-command." (interactive) (byte-code "┴ê┬ ?à
  111. ├ ê─┼╞P\"ê╟┴!ç" [latexinfo-show-latex-queue-command nil latexinfo-latex-shell-running-p latexinfo-latex-start-shell send-string "latexinfo-latex-shell" "
  112. " latexinfo-recenter-latex-output-buffer] 6))
  113.  
  114. (defun latexinfo-delete-from-latex-print-queue (job-number) "\
  115. Delete job from the line printer spooling queue.
  116. You are prompted for the job number (shown by a previous
  117. \\[latexinfo-show-latex-print-queue] command." (interactive "nPrinter job number for deletion: ") (byte-code "┬ê├ â ─ é┼ ê╞╟╚    ╔R\"ê╩┬!ç" [latexinfo-delete-from-print-queue-command job-number nil latexinfo-latex-shell-running-p latexinfo-kill-latex-job latexinfo-latex-start-shell send-string "latexinfo-latex-shell" " " "
  118. " latexinfo-recenter-latex-output-buffer] 9))
  119.  
  120. (defun latexinfo-latex-shell-running-p nil (byte-code "└┴!à
  121. ┬└┴!!├=ç" [get-process "latexinfo-latex-shell" process-status run] 5))
  122.  
  123. (provide (quote latexnfo-tex))
  124.