emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: [BABEL] reload source code file after tangling?


From: Bernt Hansen
Subject: Re: [Orgmode] Re: [BABEL] reload source code file after tangling?
Date: Fri, 02 Jul 2010 09:27:50 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Rainer M Krug <address@hidden> writes:

> On Fri, Jul 2, 2010 at 3:11 PM, Bernt Hansen <address@hidden> wrote:
>
>     Rainer M Krug <address@hidden> writes:
>    
>     > On Fri, Jul 2, 2010 at 2:09 PM, Bernt Hansen <address@hidden> wrote:
>     >
>     >     Rainer M Krug <address@hidden> writes:
>     >
>     >     > is it possible to open (if not open yet) or re-load the new 
> tangled
>     >     > source code after tangling?
>     >
>     >     Would global-auto-revert or auto-revert-mode do what you want?  I
>     >     personally use global-auto-revert mode so if any loaded file 
> changes on
>     >     disk and my buffer contents are unmodified it gets replaced with 
> what is
>     >     on the disk.
>     >
>     > Perfect - that is doing exactly what it should. Now I just have to
>     > remember to activate it for the buffer.
>    
>     With global-auto-revert-mode there is nothing to remember :) since it is
>     active in /all/ buffers.  This works great for me.
>
> That is definitely true - I am just a little bit (too?) vary about
> global-auto-revert-mode for files I am editing in. So they are only
> reverted, if the files on the drive have changed irrespective of the
> state of the buffer? Well - I should possibly try it.

If you modify the buffer it doesn't revert.  Only unmodified buffers
will be replaced with the contents of disk files if those change.  I use
this for org-mode files and git - save all buffers, commit changes, push
to other machine, work there, commit, fetch back to first machine, and
all my org-files automatically update without me doing anything special.

Try it on a test file or two where you modify the buffer first and don't
save then change the file on disk with another editor and see how it
works.  I haven't had any problems with it yet.

I auto-save my org-mode files every hour in my workstation emacs and I
tend to just leave my workstation emacs running forever.

,----[ .emacs ]
| (run-at-time "00:59" 3600 'org-save-all-org-buffers)
`----

I use this mainly for my cron job that automatically creates git commits
on the hour.

This has a nice side effect that I can just leave the house with my
Android phone, (the files save at 59 minutes past the hour), then I can
SSH in to my workstation, fire up another emacs process on the phone and
edit my org files and save.  They auto-revert on my workstation and
everything Just Works(tm).

-Bernt



reply via email to

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