aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-03-23 18:19:20 +0000
committerRichard M. Stallman1994-03-23 18:19:20 +0000
commita15849cbd891825a607b6c1505bc9f823bee54c0 (patch)
treec82f5d213a5e54b6cea7674621a75cd9f27ef724
parentec26e1b924b5c039cf944593acf9bff7405879b8 (diff)
downloademacs-a15849cbd891825a607b6c1505bc9f823bee54c0.tar.gz
emacs-a15849cbd891825a607b6c1505bc9f823bee54c0.zip
(tex-delete-last-temp-files): New arg NOT-ALL.
(tex-region): Pass new arg.
-rw-r--r--lisp/textmodes/tex-mode.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 4beecdab124..26466716529 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -871,14 +871,20 @@ evaluates to a command string."
871 (comint-send-input) 871 (comint-send-input)
872 (setq tex-send-command-modified-tick (buffer-modified-tick buf))))) 872 (setq tex-send-command-modified-tick (buffer-modified-tick buf)))))
873 873
874(defun tex-delete-last-temp-files () 874(defun tex-delete-last-temp-files (&optional not-all)
875 "Delete any junk files from last temp file." 875 "Delete any junk files from last temp file.
876If NOT-ALL is non-nil, save the `.dvi' file."
876 (if tex-last-temp-file 877 (if tex-last-temp-file
877 (let* ((dir (file-name-directory tex-last-temp-file)) 878 (let* ((dir (file-name-directory tex-last-temp-file))
878 (list (file-name-all-completions 879 (list (file-name-all-completions
879 (file-name-nondirectory tex-last-temp-file) dir))) 880 (file-name-nondirectory tex-last-temp-file) dir)))
880 (while list 881 (while list
881 (delete-file (concat dir (car list))) 882 (if not-all
883 (and
884 ;; If arg is non-nil, don't delete the .dvi file.
885 (not (string-match "\\.dvi$" (car list)))
886 (delete-file (concat dir (car list))))
887 (delete-file (concat dir (car list))))
882 (setq list (cdr list)))))) 888 (setq list (cdr list))))))
883 889
884(add-hook 'kill-emacs-hook 'tex-delete-last-temp-files) 890(add-hook 'kill-emacs-hook 'tex-delete-last-temp-files)
@@ -913,7 +919,7 @@ The value of `tex-command' specifies the command to use to run TeX."
913 (zap-directory 919 (zap-directory
914 (file-name-as-directory (expand-file-name tex-directory))) 920 (file-name-as-directory (expand-file-name tex-directory)))
915 (tex-out-file (concat zap-directory tex-zap-file))) 921 (tex-out-file (concat zap-directory tex-zap-file)))
916 (tex-delete-last-temp-files) 922 (tex-delete-last-temp-files t)
917 ;; Write the new temp file. 923 ;; Write the new temp file.
918 (save-excursion 924 (save-excursion
919 (save-restriction 925 (save-restriction