"Keymap for the TeX shell.
Inherits `comint-mode-map' with a few additions.")
-(defvar compare-windows-whitespace nil) ; Pacify the byte-compiler
+(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.
(beginning-of-line)
(search-forward "%" search-end t))))))
(if (and slash (not comment))
- (setq mode (if (looking-at "documentstyle")
- (if (looking-at "documentstyle{slides}")
+ (setq mode (if (looking-at "documentstyle\\|documentclass")
+ (if (looking-at
+ "document\\(style\\|class\\)\\(\\[.*\\]\\)?{slides}")
'slitex-mode
'latex-mode)
'plain-tex-mode))))
^\\\\chapter\\>\\|^\\\\section\\>\\|\
^\\\\subsection\\>\\|^\\\\subsubsection\\>\\|\
^\\\\paragraph\\>\\|^\\\\subparagraph\\>\\|\
-^\\\\item[ \t]*$\\|^\\\\bibitem[ \t]*$\\|^\\\\newline[ \t]*$\\|^\\\\noindent[ \t]*$\\|\
-^\\\\[a-z]*space[ \t]*$\\|^\\\\[a-z]*skip[ \t]*$\\|\
-^\\\\newpage[ \t]*$\\|^\\\\[a-z]*page[a-z]*[ \t]*$\\|^\\\\footnote[ \t]*$\\|\
-^\\\\marginpar[ \t]*$\\|^\\\\parbox[ \t]*$\\|^\\\\caption[ \t]*$")
+\\(^\\\\item\\|^\\\\bibitem\\|^\\\\newline\\|^\\\\noindent\\|\
+^\\\\[a-z]*space\\|^\\\\[a-z]*skip\\|\
+^\\\\newpage\\|^\\\\[a-z]*page[a-z]*\\|^\\\\footnote\\|\
+^\\\\marginpar\\|^\\\\parbox\\|^\\\\caption\\)[ \t]*\\($\\|%\\)")
(run-hooks 'text-mode-hook 'tex-mode-hook 'latex-mode-hook))
;;;###autoload
(let ((proc (get-process "tex-shell")))
(set-process-sentinel proc 'tex-shell-sentinel)
(process-kill-without-query proc)
- (setq tex-shell-map (copy-keymap shell-mode-map))
+ (setq comint-prompt-regexp shell-prompt-pattern)
+ (setq tex-shell-map (copy-keymap comint-mode-map))
(tex-define-common-keys tex-shell-map)
(use-local-map tex-shell-map)
(run-hooks 'tex-shell-hook)
(zap-directory
(file-name-as-directory (expand-file-name tex-directory)))
(tex-out-file (concat zap-directory tex-zap-file)))
- (tex-delete-last-temp-files t)
+ ;; Don't delete temp files if we do the same buffer twice in a row.
+ (or (eq (current-buffer) tex-last-buffer-texed)
+ (tex-delete-last-temp-files t))
;; Write the new temp file.
(save-excursion
(save-restriction