legacy-dotfiles/emacs.d/manage-org.el
2010-12-05 12:41:38 +01:00

40 lines
1.2 KiB
EmacsLisp

(defun clone-org-files ()
(interactive)
(if (= (shell-command
"git clone git@82.170.172.156:private/org.git ~/prj/org"
"*Messages*" "*Messages*") 0)
(message "success!")
(message "failed!")))
(defun get-org-files ()
(interactive)
(let ((prev-dir (getenv "PWD")))
(if (= (shell-command
(format "cd ~/prj/org/; git pull origin master; cd %s" prev-dir)
"*Messages*" "*Messages*") 0)
(message "success!")
(message "failed!"))))
(defun save-org-files ()
(interactive)
(let ((prev-dir (getenv "PWD")))
(if (= (shell-command
(format
"cd ~/prj/org/; git add .; git commit -m \"Change for %s\"; cd %s"
(format-time-string "%Y-%m-%d at %H:%M:%S")
prev-dir)
"*Messages*" "*Messages*") 0)
(message "success!")
(message "failed!"))))
(defun push-org-files ()
(interactive)
(let ((prev-dir (getenv "PWD")))
(if (= (shell-command
(format
"cd ~/prj/org/; git push origin master; cd %s" prev-dir)
"*Messages*" "*Messages*") 0)
(message "success!")
(message "failed!"))))
(provide 'manage-org)