emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: James Harkins <jamshark70@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: Temp files are not deleted after beamer export with source code blocks
Date: Thu, 07 Nov 2013 17:21:21 +0100	[thread overview]
Message-ID: <87ob5w9o8u.fsf@gmail.com> (raw)
In-Reply-To: <c424fcdb-662a-4af3-b0b3-ed7db2426b42@dewdrop-world.net> (James Harkins's message of "Thu, 07 Nov 2013 09:34:51 +0800")

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

Hello,

James Harkins <jamshark70@gmail.com> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-latex-Remove-all-temporary-files-when-compiling.patch --]
[-- Type: text/x-diff, Size: 1302 bytes --]

From 77fb3960eacc15cdf05559235c20243d7d4eb0b1 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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


  reply	other threads:[~2013-11-07 16:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  3:00 Temp files are not deleted after beamer export with source code blocks James Harkins
2013-10-29  8:06 ` Nicolas Goaziou
2013-10-29  9:16   ` James Harkins
2013-10-29 13:19     ` Nicolas Goaziou
2013-11-06  9:44   ` James Harkins
2013-11-06 14:15     ` Nicolas Goaziou
2013-11-07  1:34       ` James Harkins
2013-11-07 16:21         ` Nicolas Goaziou [this message]
2013-11-08  7:14           ` James Harkins
2013-11-08  7:59             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ob5w9o8u.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jamshark70@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).