diff options
author | Kyle Meyer <kyle@kyleam.com> | 2018-08-04 09:54:22 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2018-08-04 09:56:14 -0400 |
commit | 0168be1073288e98c9d82e8a7f4d421760e662c7 (patch) | |
tree | 338ba9e9086197b99bfed2ddd53d86afbc6e1b5d | |
parent | 27510060cac0010353a7e2968c06cf4d533a54f0 (diff) | |
download | emacs.d-0168be1073288e98c9d82e8a7f4d421760e662c7.tar.gz |
org: Make some operations trigger saving buffers
-rw-r--r-- | init.el | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -169,6 +169,14 @@ (lambda (f form &rest _) (funcall f form 'keepdate)) '((name . "always-keepdate"))) + (advice-add + 'org-refile :around + (lambda (f &rest args) + (apply f args) + (when (bound-and-true-p org-capture-is-refiling) + (org-save-all-org-buffers))) + '((name . "org-save-after-capture-refile"))) + (bind-keys :map org-mode-map ("C-c l" . org-goto) ("C-c m" . km/org-prefix-map) @@ -229,6 +237,8 @@ (file+headline "~/notes/bookmarks.org" "Inbox") "* %?%i\n\n%x" :prepend t))) + (add-hook 'org-capture-before-finalize-hook #'save-buffer) + (require 'org-agenda) (require 'org-contacts)) @@ -319,6 +329,23 @@ (user-error "Archiving aborted"))) '((name . "org-board-archive-confirm")))) +(use-package org-clock + :config + (advice-add + 'org-clock-in :after + (lambda (&rest _) (org-save-all-org-buffers)) + '((name . "org-clock-in-save-buffers"))) + + (advice-add + 'org-clock-out :after + (lambda (&rest _) (org-save-all-org-buffers)) + '((name . "org-clock-out-save-buffers"))) + + (advice-add + 'org-resolve-clocks :after + (lambda (&rest _) (org-save-all-org-buffers)) + '((name . "org-resolve-clocks-save-buffers")))) + (use-package km-org :init (bind-keys :map km/org-prefix-map |