emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: Rainer M Krug <r.m.krug@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Re: [BABEL] reload source code file after tangling?
Date: Fri, 02 Jul 2010 09:27:50 -0400	[thread overview]
Message-ID: <87wrte6mjt.fsf@gollum.intra.norang.ca> (raw)
In-Reply-To: <AANLkTilihSPaE-ABwvLvEjOy-8XapKjbsF5dMokmfCF4@mail.gmail.com> (Rainer M. Krug's message of "Fri\, 2 Jul 2010 15\:17\:55 +0200")

Rainer M Krug <r.m.krug@gmail.com> writes:

> On Fri, Jul 2, 2010 at 3:11 PM, Bernt Hansen <bernt@norang.ca> wrote:
>
>     Rainer M Krug <r.m.krug@gmail.com> writes:
>    
>     > On Fri, Jul 2, 2010 at 2:09 PM, Bernt Hansen <bernt@norang.ca> wrote:
>     >
>     >     Rainer M Krug <r.m.krug@gmail.com> 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	other threads:[~2010-07-02 13:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-02  7:25 [BABEL] reload source code file after tangling? Rainer M Krug
2010-07-02 12:09 ` Bernt Hansen
2010-07-02 12:55   ` Rainer M Krug
2010-07-02 13:11     ` Bernt Hansen
2010-07-02 13:17       ` Rainer M Krug
2010-07-02 13:27         ` Bernt Hansen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wrte6mjt.fsf@gollum.intra.norang.ca \
    --to=bernt@norang.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=r.m.krug@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).