From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Temp files are not deleted after beamer export with source code blocks Date: Thu, 07 Nov 2013 17:21:21 +0100 Message-ID: <87ob5w9o8u.fsf@gmail.com> References: <87hac0a4ca.fsf@gmail.com> <87txfpboq7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeSKY-0008Tb-5o for emacs-orgmode@gnu.org; Thu, 07 Nov 2013 11:21:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeSKP-0004Mx-0v for emacs-orgmode@gnu.org; Thu, 07 Nov 2013 11:21:14 -0500 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]:55041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeSKO-0004Ly-PE for emacs-orgmode@gnu.org; Thu, 07 Nov 2013 11:21:04 -0500 Received: by mail-ea0-f179.google.com with SMTP id q15so384175ead.10 for ; Thu, 07 Nov 2013 08:21:04 -0800 (PST) In-Reply-To: (James Harkins's message of "Thu, 07 Nov 2013 09:34:51 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: James Harkins Cc: orgmode --=-=-= Content-Type: text/plain Hello, James Harkins writes: > Hm, you're right -- I was sure they are hyphens, but I just looked > again and they are indeed dots. Thanks for checking. > As a final test, I deleted all the .vrb files manually and exported my > document again. Then, after the export process finished, I refreshed > a dired buffer for the directory in question: > > -rw-rw-r-- 1 dlm dlm 504 Nov 7 09:28 lp-slides.5.vrb > -rw-rw-r-- 1 dlm dlm 667 Nov 7 09:28 lp-slides.6.vrb > -rw-rw-r-- 1 dlm dlm 563 Nov 7 09:28 lp-slides.7.vrb > -rw-rw-r-- 1 dlm dlm 662 Nov 7 09:28 lp-slides.8.vrb > > These were all created during the last export cycle, and not deleted > by that cycle. The previous patch used a regexp matching an hyphen before the number. Here's an update which should properly remove these files. Could you confirm it? Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-latex-Remove-all-temporary-files-when-compiling.patch >From 77fb3960eacc15cdf05559235c20243d7d4eb0b1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 29 Oct 2013 09:02:29 +0100 Subject: [PATCH] ox-latex: Remove all temporary files when compiling * lisp/ox-latex.el (org-latex-compile): Remove all numbered temporary files after compiling. --- lisp/ox-latex.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index f14a1f9..1da5f52 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2900,9 +2900,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))))) -- 1.8.4.2 --=-=-=--