From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Re: [BABEL] reload source code file after tangling? Date: Fri, 02 Jul 2010 09:27:50 -0400 Message-ID: <87wrte6mjt.fsf@gollum.intra.norang.ca> References: <87630y84qv.fsf@gollum.intra.norang.ca> <871vbm81v6.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=33413 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUgHg-0005QP-1G for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 09:28:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUgHe-00064I-JT for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 09:27:59 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:52858) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUgHe-00064E-F2 for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 09:27:58 -0400 In-Reply-To: (Rainer M. Krug's message of "Fri\, 2 Jul 2010 15\:17\:55 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer M Krug Cc: emacs-orgmode Rainer M Krug writes: > On Fri, Jul 2, 2010 at 3:11 PM, Bernt Hansen wrote: > > Rainer M Krug writes: >=20=20=20=20 > > On Fri, Jul 2, 2010 at 2:09 PM, Bernt Hansen wrot= e: > > > > =C2=A0 =C2=A0 Rainer M Krug writes: > > > > =C2=A0 =C2=A0 > is it possible to open (if not open yet) or re-load= the new tangled > > =C2=A0 =C2=A0 > source code after tangling? > > > > =C2=A0 =C2=A0 Would global-auto-revert or auto-revert-mode do what = you want? =C2=A0I > > =C2=A0 =C2=A0 personally use global-auto-revert mode so if any load= ed file changes on > > =C2=A0 =C2=A0 disk and my buffer contents are unmodified it gets re= placed with what is > > =C2=A0 =C2=A0 on the disk. > > > > Perfect - that is doing exactly what it should. Now I just have to > > remember to activate it for the buffer. >=20=20=20=20 > With global-auto-revert-mode there is nothing to remember :) since it= is > active in /all/ buffers. =C2=A0This 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