|Subject:||Re: [O] Not overwriting unchanged source code files when tangling|
|Date:||Sat, 19 Nov 2011 01:49:30 +0100|
I think the best approach in this case would be to tangle each file outBrian Wightman <address@hidden> writes:
> On Fri, Nov 18, 2011 at 11:02 AM, Carsten Dominik
> <address@hidden> wrote:
>> How about changing the make file so that the dependence is on the Org file, not on the source file?
>> You could then arrange for make to call emacs in batch-mode to tangle the source file and then compile it?
> The original question was trying to avoid recompiling everything
> generated from a tangle if the content didn't actually change.
> Because retangling the source rewrites /all/ of the files, and resets
> the dates, even if nothing has changed, make will then rebuild
> everything that was tangled, not just the partial set of tangled files
> that actually changed.
to a temporary buffer, and then just before exiting the tangle function
the content of these temporary buffers could be checked against the
files on disk, and only those buffers which differ from disk would be
written. See ob-tangle.el around line 240 for the relevant code.
Unfortunately this would not be trivial, as currently content is written
to the target files incrementally block by block.
If the code in the .org file is grouped by subtree it may be possible to
place calls to org-narrow-to-subtree in the Makefile before tangling, so
that only part of the file is tangled.
Finally, it may be easiest simply to play make's game as it were and
break up the Org-mode file into multiple files. These multiple files
could still be combined during export using #+INCLUDE lines from a
single master Org-mode file.
Best -- Eric
|[Prev in Thread]||Current Thread||[Next in Thread]|