ox-latex: Remove all temporary files when compiling

* lisp/ox-latex.el (org-latex-compile): Remove all numbered temporary
  files after compiling.
This commit is contained in:
Nicolas Goaziou 2013-11-08 08:54:52 +01:00
parent 92f89eedba
commit b21c5fa272
1 changed files with 7 additions and 3 deletions

View File

@ -2852,9 +2852,13 @@ Return PDF file name or an error if it couldn't be produced."
;; Else remove log files, when specified, and signal end of
;; process to user, along with any error encountered.
(when (and (not snippet) org-latex-remove-logfiles)
(dolist (ext org-latex-logfiles-extensions)
(let ((file (concat out-dir base-name "." ext)))
(when (file-exists-p file) (delete-file file)))))
(dolist (file (directory-files
out-dir t
(concat (regexp-quote base-name)
"\\(?:\\.[0-9]+\\)?"
"\\."
(regexp-opt org-latex-logfiles-extensions))))
(delete-file file)))
(message (concat "Process completed"
(if (not errors) "."
(concat " with errors: " errors)))))