From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Wightman Subject: Re: Not overwriting unchanged source code files when tangling Date: Fri, 18 Nov 2011 08:23:18 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRPLd-0001cb-G7 for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 09:23:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRPLc-0006aG-FJ for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 09:23:21 -0500 Received: from mail-pz0-f47.google.com ([209.85.210.47]:42005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRPLc-0006XO-9W for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 09:23:20 -0500 Received: by pzk1 with SMTP id 1so5567567pzk.6 for ; Fri, 18 Nov 2011 06:23:18 -0800 (PST) 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 To: Holger Hoefling Cc: emacs-orgmode@gnu.org On Fri, Nov 18, 2011 at 7:17 AM, Holger Hoefling 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