diff options
author | Case Duckworth | 2021-02-10 10:17:15 -0600 |
---|---|---|
committer | Case Duckworth | 2021-02-10 10:17:15 -0600 |
commit | bbf6c6e3f170d6f472f791c40c3cac4413c44489 (patch) | |
tree | a119a3b9df71f27fcb5c350b02a725158c61cd70 | |
parent | Enable global-display-fill-column-indicator-mode (diff) | |
download | emacs-bbf6c6e3f170d6f472f791c40c3cac4413c44489.tar.gz emacs-bbf6c6e3f170d6f472f791c40c3cac4413c44489.zip |
Rewrite git-sync integration and add functions
-rw-r--r-- | config.org | 42 |
1 files 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 | |||
2835 | (add-hook 'after-init-hook #'edit-server-start) | 2835 | (add-hook 'after-init-hook #'edit-server-start) |
2836 | #+end_src | 2836 | #+end_src |
2837 | 2837 | ||
2838 | *** =git-sync= ~/org | 2838 | *** =git-sync= stuff |
2839 | 2839 | ||
2840 | I don't know where else to put this, but it's just a little command to | 2840 | This function require [[https://github.com/simonthum/git-sync][git-sync]]. |
2841 | run =git-sync= in =org-directory=. | ||
2842 | 2841 | ||
2843 | #+begin_src emacs-lisp :noweb-ref functions | 2842 | #+begin_src emacs-lisp :noweb-ref functions |
2844 | (defun acdw/org-sync () | 2843 | (defun acdw/git-sync (directory) |
2845 | "Run git-sync in `org-directory'. | 2844 | "Run git-sync in DIRECTORY." |
2845 | (interactive) | ||
2846 | (message "Git-Syncing %s..." directory) | ||
2847 | (let ((proc (start-process "git-sync" | ||
2848 | (get-buffer-create (format "*git-sync:%s*" directory)) | ||
2849 | "git" "-C" (expand-file-name directory) "sync"))) | ||
2850 | (add-function :after (process-sentinel proc) | ||
2851 | (lambda (proc ev) | ||
2852 | (cond | ||
2853 | ((string-match "finished\n\\'" ev) | ||
2854 | (message "Git-Syncing %s...Done." directory))))))) | ||
2855 | #+end_src | ||
2856 | |||
2857 | **** ~/org | ||
2858 | |||
2859 | #+begin_src emacs-lisp :noweb-ref bindings | ||
2860 | (defun acdw/git-sync-org () | ||
2861 | "Run `acdw/git-sync' on `org-directory'." | ||
2862 | (interactive) | ||
2863 | (acdw/git-sync org-directory)) | ||
2864 | |||
2865 | (define-key acdw/leader (kbd "C-M-o") #'acdw/git-sync-org) | ||
2866 | #+end_src | ||
2846 | 2867 | ||
2847 | Requires git-sync." | 2868 | **** ~/.cache/elfeed/db |
2869 | |||
2870 | #+begin_src emacs-lisp :noweb-ref bindings | ||
2871 | (defun acdw/git-sync-elfeed-db () | ||
2872 | "Run `acdw/git-sync' on `elfeed-db-directory'." | ||
2848 | (interactive) | 2873 | (interactive) |
2849 | (async-shell-command | 2874 | (acdw/git-sync elfeed-db-directory)) |
2850 | (format "git -C %s sync" (expand-file-name org-directory)))) | ||
2851 | 2875 | ||
2852 | (define-key acdw/leader (kbd "C-M-o") #'acdw/org-sync) | 2876 | (define-key acdw/leader (kbd "C-M-f") #'acdw/git-sync-elfeed-db) |
2853 | #+end_src | 2877 | #+end_src |
2854 | 2878 | ||
2855 | ** Linux (home) | 2879 | ** Linux (home) |