emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Francesco Pizzolante <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org>
To: Eric Schulte <schulte.eric-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: mailing-list-org-mode <emacs-orgmode-mXXj517/zsQ@public.gmane.org>
Subject: Re: [PATCH] sha1 hash of latex fragments to avoid regeneration
Date: Mon, 07 Dec 2009 13:48:22 +0100	[thread overview]
Message-ID: <87ljhfuezt.fsf@missioncriticalit.com> (raw)
In-Reply-To: <yn43a3pqsyw.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (Eric Schulte's message of "Sat, 05 Dec 2009 09:35:35 -0700")

Eric,

> Would it be possible to switch from using org-exp-blocks to using
> org-babel?  If so then you could use org-babel's caching which does
> *not* affect the exported file name, but rather saves a sha1 key as
> (mostly) hidden text in the org-mode buffer.
>
> so for example
>
> #+BEGIN_ditaa procedure.png
>      +-----------------+
>      |     Example     |
>      |                 |
>      |   +---------+   |
>      |   |         |   |
>      |   |         |   |
>      |   +---------+   |
>      +-----------------+
> #+END_ditaa
>
> would be written as
>
> #+begin_src ditaa :file procedure.png :cache :exports results
>      +-----------------+
>      |     Example     |
>      |                 |
>      |   +---------+   |
>      |   |         |   |
>      |   |         |   |
>      |   +---------+   |
>      +-----------------+
> #+end_src
>
> and pressing C-cC-c on the block (or exporting) would result in the
> insertion of a link to the resulting image into the org-mode buffer
> behind a results line as follows -- only in org most of the hash is
> hidden.
>
> #+results[bdffac60833c9f925a52bd6617dace39832b7dda]:
> [[file:procedure.png]]

I don't see any problem in using org-babel. The only issues I see with this
solution are the following:

- when you export, no #+results line is added to the org-mode buffer;

- you, thus, have to do the C-cC-c at least once in your block to generate
  the #+results line;

- when you export (to LaTeX or PDF), the image is always re-computed (no
  caching mechanism is used), while doing C-cC-c, the caching is used.

Can you confirm these points?


> My problem with your proposed solution is that it entails storing
> information *outside* of the org-mode buffer -- which granted we are
> already doing although in a less dramatic way.  The creation of external
> files whose sole purpose is to save a hash in their filename strikes me
> as wasteful/messy.

I agree with your point. I was "simply" trying to reuse what has been done for
the caching of images in org. The org-babel solution is more elegant.

Thanks,
F.


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2009-12-07 12:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16  0:07 [PATCH] sha1 hash of latex fragments to avoid regeneration Eric Schulte
2009-11-16  6:57 ` Carsten Dominik
2009-11-17  0:11   ` Eric Schulte
2009-11-17  2:42     ` Eric Schulte
2009-11-17 13:21       ` Carsten Dominik
2009-11-17 15:24         ` Eric Schulte
2009-11-17 15:36           ` Carsten Dominik
2009-11-17 17:02             ` Eric Schulte
     [not found]               ` <m23a4dozic.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-02 10:35                 ` Francesco Pizzolante
2009-12-05 16:35                   ` Eric Schulte
     [not found]                     ` <yn43a3pqsyw.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-07 12:48                       ` Francesco Pizzolante [this message]
2009-12-23 15:17                         ` Eric Schulte
2009-11-17 13:14     ` Carsten Dominik

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=87ljhfuezt.fsf@missioncriticalit.com \
    --to=fpz-djc/ipccudyqhejpep6iedvlejwurmry@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    --cc=schulte.eric-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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).