From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Not overwriting unchanged source code files when tangling Date: Fri, 18 Nov 2011 14:32:36 -0500 Message-ID: <5701.1321644756@alphaville.americas.hpqcorp.net> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRUsE-00016d-W1 for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 15:17:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRUsC-0005NA-Qf for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 15:17:22 -0500 Received: from g1t0026.austin.hp.com ([15.216.28.33]:12685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRUsC-0005Ld-LH for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 15:17:20 -0500 In-Reply-To: Message from Holger Hoefling of "Fri, 18 Nov 2011 20:01:55 +0100." 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 To: Holger Hoefling Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org, Carsten Dominik Holger Hoefling wrote: > Hi Carsten, > > thanks for the suggestion, but as I agree with Brian. If there is more > than one source file in the org-file, then the whole project would > still be recompiled, not just the updated file. > > To be more exact, I actually don't want to compile things, but run R > scripts using make. So the waiting time if a computationally intensive > step is repeated although it is not necessary can be substantial. > > I wonder how difficult the following change would be (no emacs lisp experience, also do not know the org source code): > > - would it be possible to write out the source files when tangling > - into a temporary directory, then compare to the actual target files > - and overwrite only if something has changed? Then the time stamps > - would stay fixed. Hopefully, this would not involve too much work: You've lost right there unless there is a method to select *which* source blocks to tangle. IOW, the problem is not the *comparison* of the temp and actual target files, it is the *production* of the temp files themselves: that's the computationally expensive step and this method does nothing to alleviate that. Unless I'm missing something. Nick > - creating temporary files and remembering the mapping to true files > - tangling out as usual into temporary files (so probably little > - change there) > - compare temporary file to true file (does emacs already have a diff > - utility that could be used?) > - overwrite true file if any changes > - delete temporary files