Skip to content

Instantly share code, notes, and snippets.

@markhepburn
Created February 10, 2013 11:59
Show Gist options
  • Select an option

  • Save markhepburn/4749358 to your computer and use it in GitHub Desktop.

Select an option

Save markhepburn/4749358 to your computer and use it in GitHub Desktop.

Revisions

  1. markhepburn renamed this gist Feb 10, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. markhepburn created this gist Feb 10, 2013.
    19 changes: 19 additions & 0 deletions mobile-org push
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    (defvar org-mobile-push-timer nil
    "Timer that `org-mobile-push-timer' used to reschedule itself, or nil.")

    (defun org-mobile-push-with-delay (secs)
    (when org-mobile-push-timer
    (cancel-timer org-mobile-push-timer))
    (setq org-mobile-push-timer
    (run-with-idle-timer
    (* 1 secs) nil 'org-mobile-push)))

    (add-hook 'after-save-hook
    (lambda ()
    (when (eq major-mode 'org-mode)
    (dolist (file (org-mobile-files-alist))
    (if (string= (expand-file-name (car file)) (buffer-file-name))
    (org-mobile-push-with-delay 30)))
    )))

    (run-at-time "00:05" 86400 '(lambda () (org-mobile-push-with-delay 1))) ;; refreshes agenda file each day