From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: org babel before excute hook Date: Fri, 11 Oct 2013 16:31:38 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c81e62e2e204e87d011e Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUjNA-0003Je-U7 for emacs-orgmode@gnu.org; Fri, 11 Oct 2013 16:31:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUjN6-00065b-O9 for emacs-orgmode@gnu.org; Fri, 11 Oct 2013 16:31:44 -0400 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]:37856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUjN6-00065Q-HO for emacs-orgmode@gnu.org; Fri, 11 Oct 2013 16:31:40 -0400 Received: by mail-pb0-f47.google.com with SMTP id rr4so4727727pbb.34 for ; Fri, 11 Oct 2013 13:31:38 -0700 (PDT) In-Reply-To: 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 Cc: "emacs-orgmode@gnu.org" --e89a8ff1c81e62e2e204e87d011e Content-Type: text/plain; charset=ISO-8859-1 I have a related kind of problem. When preparing notes for a class, I may end up with 70 code blocks in an org file, many of which create graphics. I am always worried about accidentally using the same filename and overwriting a graphic from an earlier block. A unique, but reproducible filename would be sufficient for my needs. John John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Fri, Oct 11, 2013 at 9:56 AM, Henning Redestig wrote: > I collaborate with different people on the same orgfile which contains > many source blocks that generate graphics by e.g. :results graphics abc.pdf > > It can happen that I or someone else accidentally create another > independent source block that overwrites my abc.pdf which is of course very > bad. > > I would like to add functionality so that org-babel-execute-src-block > checks if in :results graphics FILE, FILE is already referred to by another > source block and if so refuse to evaluate. > > However, I only see a org-babel-after-execute-hook but no > org-babel-before-execute-hook > > any reason for this? I could try to write a patch but thought I'd ask > first. > > ....or if there is an even better approach to avoid overwriting output > from different source blocks.. > > //Henning > --e89a8ff1c81e62e2e204e87d011e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I have a related kind of problem. When pr= eparing notes=20 for a class, I may end up with 70 code blocks in an org file, many of=20 which create graphics. I am always worried about accidentally using the=20 same filename and overwriting a graphic from an earlier block. A unique, but reproducible filename would be sufficient for my needs.

John

John

-----------------------------------
John KitchinAssociate Professor
Doherty Hall A207F
Department of Chemical Engine= ering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingr= oup.cheme.cmu.edu



On Fri, Oct 11, 2013 at 9:56 AM, Henning= Redestig <henning.red@gmail.com> wrote:
I collaborate with different= people on the same orgfile which contains many source blocks that generate= graphics by e.g. :results graphics abc.pdf

It can happen that= I or someone else accidentally create another independent source block tha= t overwrites my abc.pdf which is of course very bad.

I would like to add functionality so that org-babel-execute-src-b= lock checks if in :results graphics FILE, FILE is already referred to by an= other source block and if so refuse to evaluate.

However, I o= nly see a org-babel-after-execute-hook but no org-babel-before-execute-hook=

any reason for this? I could try to write a patch but thought I&#= 39;d ask first.

....or if there is an even better approach to= avoid overwriting output from different source blocks..

//He= nning

--e89a8ff1c81e62e2e204e87d011e--