emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Leo Alekseyev <dnquark@gmail.com>
To: Emacs orgmode <emacs-orgmode@gnu.org>
Subject: Re: org-babel autosave
Date: Mon, 13 Feb 2012 21:38:06 -0500	[thread overview]
Message-ID: <CADzxs1nDVzC=rtw5jGDf6vJemboJXN-QHDtvWCKJf=Cy=K57Mg@mail.gmail.com> (raw)
In-Reply-To: <AE36FF71-1451-40A9-BCAC-4E725CFD4C64@gmail.com>

Yes, but the question is -- what is the desired behavior?  If you just
want to autosave the temporary org-src buffer, see my question on
stack overflow:

http://stackoverflow.com/q/8849661/133234

In short, you'd just need to   (add-hook 'org-src-mode-hook '(lambda
() (auto-save-mode t))) and specify the appropriate file name.

This has the drawback that the autosave fill will never be removed,
since the org-src buffers never actually get saved.

A better solution would be to auto-save the underlying org-buffer.  I
am not sure how to do this for timed autosave.  For manual
do-auto-save, the following works.

 (defadvice do-auto-save (around do-auto-save-org-src activate)
   (if org-src-mode
       (org-src-in-org-buffer (do-auto-save))
     ad-do-it))

I tried putting this into an autosave-hook and disable the hook on
invocation from org, but couldn't avoid infinite recursion.  Perhaps
someone more experienced can come up with the right solution.


On Mon, Feb 13, 2012 at 7:36 PM, Colin Maxwell <cs.maxwell@gmail.com> wrote:
> Hello,
> I've noticed that autosaving does not operate when you are editing an org-babel buffer via C-c '. Is there a way to turn it on?
>
>
> cheers,
> Colin

      reply	other threads:[~2012-02-14  2:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14  0:36 org-babel autosave Colin Maxwell
2012-02-14  2:38 ` Leo Alekseyev [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='CADzxs1nDVzC=rtw5jGDf6vJemboJXN-QHDtvWCKJf=Cy=K57Mg@mail.gmail.com' \
    --to=dnquark@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).