Created
May 31, 2014 18:54
-
-
Save psamim/1fb8ba2ac36c557f502d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defun psamim-push-gtasks-todos () | |
"Asynchronously syncs to Google tasks" | |
(interactive) | |
(org-tags-sparse-tree t "+TODO=\"NEXT\"") | |
(org-export-visible ?\s nil) | |
(delete-matching-lines "^\* .*") | |
(replace-string "** NEXT" "*") | |
(write-file psamim-mobile-todo-org-file nil) | |
(my-window-killer) | |
(message "Pushing todos started") | |
(let ((process | |
(start-process | |
"gtasks-sync" "*sync-output*" "/bin/sh" "-c" | |
(concat | |
;; Uses michel-orgmode script | |
"torify ~/src/michel-orgmode/michel/michel.py --push --orgfile " | |
psamim-mobile-todo-org-file | |
" --listname " | |
psamim-mobile-todo-list)))) | |
(set-process-sentinel process 'gtasks-sentinel))) | |
(defun gtasks-sentinel (p e) | |
"Display the result of the sync" | |
(if (= 0 (process-exit-status p)) | |
(message "Google tasks sync was successful") | |
(message "Sync failed"))) | |
(provide 'init-sync) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment