summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-11-08 08:54:52 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2013-11-08 08:54:52 +0100
commitb21c5fa2724ea3a0efc073f7231cce6349a397cf (patch)
tree8db307892567dc727f0c128fb88a919afc6ae25d
parent92f89eedbad33376ffbcc383f1167f8bfa11ca05 (diff)
downloadorg-mode-b18627aa41aa0c4cbafc28e0ebe54ee27fcf275d.tar.gz
ox-latex: Remove all temporary files when compilingrelease_8.2.2
* lisp/ox-latex.el (org-latex-compile): Remove all numbered temporary files after compiling.
-rw-r--r--lisp/ox-latex.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 339f5a3..1da7f9b 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -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)))))