emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Automatic tangling/detangling


From: Diego Zamboni
Subject: Re: [O] Automatic tangling/detangling
Date: Sat, 3 Mar 2018 17:47:56 +0100

Hi Matthew,

How do you do the untangling? I have been using an after-hook call to org-babel-tangle, which works quite well. It is a bit slow for large files with many code segments (like my Emacs init file at https://github.com/zzamboni/dot-emacs/blob/master/init.org), and it requires a bit of discipline for editing only the org file and not the output file, but works well otherwise. I have never tried to de-tangle, that would require some markers in the output file I guess?

Here’s the code I use at the moment I am super happy with it, as it prevents my output files to get out of sync from the org file:

(add-hook 'org-mode-hook
          (lambda () (add-hook 'after-save-hook 'org-babel-tangle
                               'run-at-end 'only-in-org-mode)))

Best,
—Diego

On 3 Mar 2018, at 04:38, Matthew Bauer <address@hidden> wrote:

Is there any good way to automatically tangle Org files and detangle tangled files? I frequently use this workflow but they often get out of sync. I have tried adding an after-save-hook but it’s too slow to be useful. Something like auto revert mode might work better...

Anyone have solutions for this?

-Matthew Bauer


reply via email to

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