From bbf6c6e3f170d6f472f791c40c3cac4413c44489 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 10 Feb 2021 10:17:15 -0600 Subject: Rewrite git-sync integration and add functions --- config.org | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/config.org b/config.org index da3e495..18abf17 100644 --- a/config.org +++ b/config.org @@ -2835,21 +2835,45 @@ Emacs (or the [[https://chrome.google.com/webstore/detail/edit-with-emacs/ljobjl (add-hook 'after-init-hook #'edit-server-start) #+end_src -*** =git-sync= ~/org +*** =git-sync= stuff -I don't know where else to put this, but it's just a little command to -run =git-sync= in =org-directory=. +This function require [[https://github.com/simonthum/git-sync][git-sync]]. #+begin_src emacs-lisp :noweb-ref functions - (defun acdw/org-sync () - "Run git-sync in `org-directory'. + (defun acdw/git-sync (directory) + "Run git-sync in DIRECTORY." + (interactive) + (message "Git-Syncing %s..." directory) + (let ((proc (start-process "git-sync" + (get-buffer-create (format "*git-sync:%s*" directory)) + "git" "-C" (expand-file-name directory) "sync"))) + (add-function :after (process-sentinel proc) + (lambda (proc ev) + (cond + ((string-match "finished\n\\'" ev) + (message "Git-Syncing %s...Done." directory))))))) +#+end_src + +**** ~/org + +#+begin_src emacs-lisp :noweb-ref bindings + (defun acdw/git-sync-org () + "Run `acdw/git-sync' on `org-directory'." + (interactive) + (acdw/git-sync org-directory)) + + (define-key acdw/leader (kbd "C-M-o") #'acdw/git-sync-org) +#+end_src - Requires git-sync." +**** ~/.cache/elfeed/db + +#+begin_src emacs-lisp :noweb-ref bindings + (defun acdw/git-sync-elfeed-db () + "Run `acdw/git-sync' on `elfeed-db-directory'." (interactive) - (async-shell-command - (format "git -C %s sync" (expand-file-name org-directory)))) + (acdw/git-sync elfeed-db-directory)) - (define-key acdw/leader (kbd "C-M-o") #'acdw/org-sync) + (define-key acdw/leader (kbd "C-M-f") #'acdw/git-sync-elfeed-db) #+end_src ** Linux (home) -- cgit 1.4.1-21-gabe81