summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el27
1 files changed, 27 insertions, 0 deletions
diff --git a/init.el b/init.el
index fc7697e..e240c90 100644
--- a/init.el
+++ b/init.el
@@ -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