emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Not overwriting unchanged source code files when tangling


From: Brian Wightman
Subject: Re: [O] Not overwriting unchanged source code files when tangling
Date: Fri, 18 Nov 2011 08:23:18 -0600

On Fri, Nov 18, 2011 at 7:17 AM, Holger Hoefling <address@hidden> wrote:
> I have a problem/request for org-mode and was looking for help. I am using
> org-mode to write source code files and tangle them out. I want to compile
> them using make. My problem now is that org-mode overwrites the old files
> every time I tangle them out, therefore also updating the time stamp - even
> if nothing has changed. Subsequently, when I run make, everything gets
> recompiled, not just the changed source code files as all time stamps have
> changed.
>
> Is there an option for org-mode to only overwrite source code files that get
> tangled out if they have truly changed?

I believe that to do this, you would need to have a dependency tree of
the nodes contributing to the output (perhaps already exists), and
recursively mark any node that refers to a node that changed as dirty.
 You would also have to store last update times on each node so that
they could be compared to each output file, contributing to the
determination of needing a regeneration or not.

>From a make standpoint, if you were to have each node in a file (I am
not recommending this), make already has the smarts to handle this.
It just becomes unwieldy to manage from an editing perspective.

Perhaps a way to deal with this would be to tangle to a different
directory, and then sync any changes into your compilation source
directory.  If you would update the compilation directory only when
something differs from the tangle directory, then make could handle it
from that point on.

Brian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]