Try to improve the org sync strategy

Save org files upon changing todo state, but use a timer to prevent
saving too many times when (e.g.) cycling through todo states.
master
Jacopo De Simoi 3 years ago
parent 4407f4a871
commit 164a5c07f3
  1. 11
      global.org

@ -1404,6 +1404,17 @@
(add-hook 'auto-save-hook 'org-save-all-org-buffers-except-current)
#+end_src
Also, we need to trigger saving once the state changes, so that we
are always able to sync the right state; saving runs with a timer
so that it is not triggered e.g. when cycling through states. The
problem with the current implementation is that we do not know
which buffer has been modified if the state has been changed using
the agenda, which is kind of the point…
#+begin_src emacs-lisp
(add-hook 'org-after-todo-state-change-hook
(lambda ()
(when buffer-file-name (save-buffer-with-timer 5))))
#+end_src
*** Reverting stuff from orgzly
#+begin_src emacs-lisp
(defun org-revert-all-orgzly-buffers (&optional ALL)

Loading…
Cancel
Save