From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: Automatic tangling/detangling Date: Sat, 3 Mar 2018 23:53:31 +0100 Message-ID: <298CD440-5F4F-4C5B-942E-D02D1248B818@zzamboni.org> References: <27AF096F-3FFC-47E1-85F0-77FA9361F33A@zzamboni.org> Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esG2A-0004Ph-55 for emacs-orgmode@gnu.org; Sat, 03 Mar 2018 17:53:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esG24-0004Eu-9j for emacs-orgmode@gnu.org; Sat, 03 Mar 2018 17:53:41 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:52620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1esG23-0004EG-Lx for emacs-orgmode@gnu.org; Sat, 03 Mar 2018 17:53:35 -0500 Received: by mail-wm0-x235.google.com with SMTP id t3so9328910wmc.2 for ; Sat, 03 Mar 2018 14:53:35 -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" To: Matthew Bauer Cc: Diego Zamboni , emacs-orgmode@gnu.org Interesting! I didn=E2=80=99t know about org-babel-detangle. I=E2=80=99d = be very interested in what you come up with. I=E2=80=99ll try to do some = exploration on my own as well. Best, =E2=80=94Diego > On 3 Mar 2018, at 22:50, Matthew Bauer wrote: >=20 > Yes, detangling works okay for me. I just setup properties like this: >=20 > * Emacs Init file > :PROPERTIES: > :header-args: :tangle yes :comments link > :END: >=20 > ...etc. >=20 > And you can open the generated file and run "org-babel-detangle" when > you are done editing it. >=20 > I guess I'm interesting in finding some "smarter" ways to do this. > Using 'append' might work better than what I have. I'm also looking in > to doing some sort of "async" usage (using some checks so multiple > tangles don't run at once). >=20 > I wonder if there's an easy way to setup "locks" in Emacs so you can > only edit one file at a time (kind of like how auto revert works). > Still researching all of this. >=20 > On Sat, Mar 3, 2018 at 10:47 AM, Diego Zamboni = wrote: >> Hi Matthew, >>=20 >> 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? >>=20 >> Here=E2=80=99s 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: >>=20 >> (add-hook 'org-mode-hook >> (lambda () (add-hook 'after-save-hook 'org-babel-tangle >> 'run-at-end 'only-in-org-mode))) >>=20 >>=20 >> Best, >> =E2=80=94Diego >>=20 >> On 3 Mar 2018, at 04:38, Matthew Bauer wrote: >>=20 >> 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=E2=80=99s too slow to be = useful. Something >> like auto revert mode might work better... >>=20 >> Anyone have solutions for this? >>=20 >> -Matthew Bauer >>=20 >>=20