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: Tue, 14 Aug 2012 19:10:18 -0700 (PDT) Message-ID: References: <87pq6thr74.fsf@gnu.org> Reply-To: Ken Mankoff Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1T3w-00017Y-Sb for emacs-orgmode@gnu.org; Tue, 14 Aug 2012 22:10:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1T3w-0000zR-78 for emacs-orgmode@gnu.org; Tue, 14 Aug 2012 22:10:24 -0400 In-Reply-To: <87pq6thr74.fsf@gnu.org> 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: Bastien Cc: emacs-orgmode@gnu.org >> How can I wrap that to only run when the active buffer is in Org >> Mode? > > (run-at-time "00:10" 10 (lambda () (if (eq major-mode 'org-mode) > (org-mobile-push)))) That works well. After reading run-at-time documentation, the "00:10" isn't ideal. I now use the following, which syncs files every 60 seconds starting 1 minute after launching emacs: (run-at-time "1 min" 60 (lambda () (if (eq major-mode 'org-mode)(org-mobile-push)))) Thanks, -k.