emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: Not overwriting unchanged source code files when tangling
Date: Fri, 18 Nov 2011 20:51:34 +0100	[thread overview]
Message-ID: <871ut59pkp.fsf@Rainer.invalid> (raw)
In-Reply-To: CAFDswJtsPiuF3Ofb+QDvRWDtZSJ6zqvx2PfA2tXOC6PA=5qGHQ@mail.gmail.com

Holger Hoefling <hhoeflin@gmail.com> writes:
> 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.

Make really doesn't have the smarts to deal with builds that it doesn't
fully control.  In your case, the actual source aren't the tangled
files, but really (parts of) an orgmode file.  With a bit of clever
organization it should be possible to employ git to keep track of the
"sources" for make.  In a nutshell, you'd check in the sources into a
repository and only compile those that are different from the last
commit.  After the successful compile you autocommit the tangled files.
Since you will probably don't need version control of the tangled files
(although that might be useful for debugging of the tangling process
itself), you could either amend each commit or just periodically chop
the repository and do a garbage collect.

Putting the smarts into orgmode to keep track of each tangle block looks
complicated in the general case; while possible is a bit of a stretch
IMHO.  It would also produce false positives for a lot of cases that I'd
consider useful (splitting or fusioning tangle blocks without changing
the result).  But the solution outlined above could be used if the
content of each file to be tangled was always available in full in a
buffer before writing to the tangled file.  The buffer could just be
dropped if the SHA1 of the file on disk and the buffer content is
identical.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Terratec KOMPLEXER:
http://Synth.Stromeko.net/Downloads.html#KomplexerWaves

  parent reply	other threads:[~2011-11-18 19:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 13:17 Not overwriting unchanged source code files when tangling Holger Hoefling
2011-11-18 14:23 ` Brian Wightman
2011-11-18 16:46   ` Tom Prince
2011-11-18 17:14     ` Brian Wightman
2011-11-18 14:27 ` Sebastien Vauban
2011-11-18 17:02 ` Carsten Dominik
2011-11-18 17:28   ` Brian Wightman
2011-11-18 19:42     ` Eric Schulte
2011-11-18 20:10       ` Achim Gratz
2011-11-18 20:24         ` Eric Schulte
2011-11-19  0:49       ` Holger Hoefling
2011-11-18 19:01   ` Holger Hoefling
2011-11-18 19:32     ` Nick Dokos
2011-11-19  0:51       ` Holger Hoefling
2011-11-19  4:00         ` Nick Dokos
2011-11-19  6:58           ` Holger Hoefling
2011-11-19 18:32             ` Holger Hoefling
2011-11-22 21:17               ` Allen S. Rout
2011-11-22 21:43                 ` Nick Dokos
2011-11-19 18:06     ` cberry
2011-11-18 19:51 ` Achim Gratz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-19 15:31 Rustom Mody
2011-11-19 15:51 ` Rustom Mody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ut59pkp.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).