emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Caching latex preview images
@ 2012-12-25 11:21 Abdó Roig-Maranges
  2012-12-28 12:24 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Abdó Roig-Maranges @ 2012-12-25 11:21 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Eric Schulte

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


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1074 bytes --]

From cd284a858a653c28e42b09fa07f172172ceba510 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Abd=C3=B3=20Roig-Maranges?= <abdo.roig@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Caching latex preview images
  2012-12-25 11:21 [PATCH] Caching latex preview images Abdó Roig-Maranges
@ 2012-12-28 12:24 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-12-28 12:24 UTC (permalink / raw)
  To: Abdó Roig-Maranges; +Cc: emacs-orgmode, Eric Schulte

Hi Abdó,

Abdó Roig-Maranges <abdo.roig@gmail.com> writes:

> 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.

Applied in master, thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-28 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-25 11:21 [PATCH] Caching latex preview images Abdó Roig-Maranges
2012-12-28 12:24 ` Bastien

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).