[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] auto-push to mobile (but only when editing org buffer)
From: |
Ken Mankoff |
Subject: |
Re: [O] auto-push to mobile (but only when editing org buffer) |
Date: |
Fri, 17 Aug 2012 15:53:07 -0700 |
On Thu, Aug 16, 2012 at 2:54 PM, Ken Mankoff <address@hidden> wrote:
> Hi Marcel,
>
> On Wed, Aug 15, 2012 at 12:33 AM, Marcel van der Boom <address@hidden> 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.