Hi,

Org mode lost the ability to reuse already generated latex preview
images in commit 27101a3e0ee7. Now it just regenerates all of them every
time.

I don't see a reason for removing this feature (am I missing
something?), so here is a little patch reintroducing that feature. I'm
also mailing the author of that commit.

Abdó Roig-Maranges.

>From cd284a858a653c28e42b09fa07f172172ceba510 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= <abdo.r...@gmail.com>
Date: Tue, 23 Oct 2012 18:44:24 +0200
Subject: [PATCH] org.el: Don't re-generate latex previews if already present

* org.el (org-format-latex): Do not re-generate a latex preview if the
  image already exists. This feature was lost in commit 27101a3e0ee7
---
 lisp/org.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ee4c70e..3ba1ab8 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -17636,8 +17636,9 @@ Some of the options can be changed using the variable
 	      (unless checkdir ; make sure the directory exists
 		(setq checkdir t)
 		(or (file-directory-p todir) (make-directory todir t)))
-	      (org-create-formula-image
-	       txt movefile optnew forbuffer processing-type)
+	      (unless (file-exists-p movefile)
+		(org-create-formula-image
+		 txt movefile optnew forbuffer processing-type))
 	      (if overlays
 		  (progn
 		    (mapc (lambda (o)
-- 
1.8.0.2

Reply via email to