Re: [O] Automatic tangling/detangling

2018-03-03 Thread Diego Zamboni
Interesting! I didn’t know about org-babel-detangle. I’d be very interested in 
what you come up with. I’ll try to do some exploration on my own as well.

Best,
—Diego

> On 3 Mar 2018, at 22:50, Matthew Bauer  wrote:
> 
> Yes, detangling works okay for me. I just setup properties like this:
> 
> * Emacs Init file
> :PROPERTIES:
> :header-args: :tangle yes :comments link
> :END:
> 
> ...etc.
> 
> And you can open the generated file and run "org-babel-detangle" when
> you are done editing it.
> 
> 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).
> 
> 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.
> 
> On Sat, Mar 3, 2018 at 10:47 AM, Diego Zamboni  wrote:
>> 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  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
>> 
>> 




Re: [O] Automatic tangling/detangling

2018-03-03 Thread Matthew Bauer
Yes, detangling works okay for me. I just setup properties like this:

* Emacs Init file
:PROPERTIES:
:header-args: :tangle yes :comments link
:END:

...etc.

And you can open the generated file and run "org-babel-detangle" when
you are done editing it.

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).

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.

On Sat, Mar 3, 2018 at 10:47 AM, Diego Zamboni  wrote:
> 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  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
>
>



Re: [O] Automatic tangling/detangling

2018-03-03 Thread Diego Zamboni
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  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



[O] Automatic tangling/detangling

2018-03-02 Thread Matthew Bauer
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