emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ken Mankoff <mankoff@gmail.com>
To: Marcel van der Boom <marcel@hsdev.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: auto-push to mobile (but only when editing org buffer)
Date: Fri, 17 Aug 2012 15:53:07 -0700	[thread overview]
Message-ID: <CAFdBzEowBOF+1m5nyxELiWjMisGEFdUqiLFDLr7Zh5tTBv71zQ@mail.gmail.com> (raw)
In-Reply-To: <CAFdBzEq8tbkAjg9YvWO64Z6z=5ZJ+x-_is_Kz-RwG2WGgxmkzA@mail.gmail.com>

On Thu, Aug 16, 2012 at 2:54 PM, Ken Mankoff <mankoff@gmail.com> wrote:
> Hi Marcel,
>
> On Wed, Aug 15, 2012 at 12:33 AM, Marcel van der Boom <marcel@hsdev.com> wrote:
>> Perhaps you will find https://gist.github.com/3111823 interesting. It
>> contains a bit of code to do the org-mobile-push asynchronously (and
>> notify me about it when done). This makes the push work in the
>> background, in my case it can take quite a while, and not interfere
>> with normal usage.
>>
>
> That is a very useful snippet. Thank you for sharing.
>
>    -k.

It took a bit of work to get that snippet working on my system, but it
works well now. On the flip side, the following watches for incoming
changes and automagically calls org-mobile-pull when needed...

;; http://stackoverflow.com/questions/3456782/emacs-lisp-how-to-monitor-ch$
(defun install-monitor (file secs)
  (run-with-timer
   0 secs
   (lambda (f p)
     (unless (< p (second (time-since (elt (file-attributes f) 5))))
       ;(message "File %s changed!" f)))
       (org-mobile-pull)))
   file secs))
(defvar monitor-timer (install-monitor "~/Dropbox/MobileOrg/mobileorg.org"$
  "Check if file changed every 30 s.")

  -k.

      reply	other threads:[~2012-08-17 22:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15  1:04 auto-push to mobile (but only when editing org buffer) Ken Mankoff
2012-08-15  1:36 ` Bastien
2012-08-15  2:10   ` Ken Mankoff
2012-08-15  7:33     ` Marcel van der Boom
2012-08-16 21:54       ` Ken Mankoff
2012-08-17 22:53         ` Ken Mankoff [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=CAFdBzEowBOF+1m5nyxELiWjMisGEFdUqiLFDLr7Zh5tTBv71zQ@mail.gmail.com \
    --to=mankoff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=marcel@hsdev.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).