Created
February 10, 2013 11:59
-
-
Save markhepburn/4749358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment