Skip to content

Instantly share code, notes, and snippets.

@lislon
Created October 28, 2015 16:08
Show Gist options
  • Select an option

  • Save lislon/c8fa07209de17d08da64 to your computer and use it in GitHub Desktop.

Select an option

Save lislon/c8fa07209de17d08da64 to your computer and use it in GitHub Desktop.
(defvar my-org-mobile-sync-timer nil)
(defvar my-org-mobile-sync-secs (* 60 20))
(defun my-org-mobile-sync-pull-and-push ()
(require 'org)
(org-mobile-pull)
(org-mobile-push)
(when (fboundp 'sauron-add-event)
(sauron-add-event 'my 3 "Called org-mobile-pull and org-mobile-push")))
(defun my-org-mobile-sync-start ()
"Start automated `org-mobile-push'"
(interactive)
(setq my-org-mobile-sync-timer
(run-with-idle-timer my-org-mobile-sync-secs t
'my-org-mobile-sync-pull-and-push)))
(defun my-org-mobile-sync-stop ()
"Stop automated `org-mobile-push'"
(interactive)
(cancel-timer my-org-mobile-sync-timer))
(my-org-mobile-sync-start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment