From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: auto-push to mobile (but only when editing org buffer) Date: Fri, 17 Aug 2012 15:53:07 -0700 Message-ID: References: <87pq6thr74.fsf@gnu.org> <20120815093316.58a112d6@hsdev.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2VPl-0004AG-2G for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 18:53:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2VPi-0003et-C5 for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 18:53:12 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:58130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2VPi-0003eh-3I for emacs-orgmode@gnu.org; Fri, 17 Aug 2012 18:53:10 -0400 Received: by lbon3 with SMTP id n3so2467431lbo.0 for ; Fri, 17 Aug 2012 15:53:08 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Marcel van der Boom Cc: emacs-orgmode@gnu.org On Thu, Aug 16, 2012 at 2:54 PM, Ken Mankoff wrote: > Hi Marcel, > > On Wed, Aug 15, 2012 at 12:33 AM, Marcel van der Boom 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.