Force reverting buffers on dropbox upon agenda reload

The auto-revert thing does not work because of sshfs, so I need to force
reloading every time the agenda is redone.  Not a big deal
master
Jacopo De Simoi 8 years ago
parent e747f5c5ca
commit b6ef6671a8
  1. 25
      global.org

@ -371,6 +371,10 @@
(add-hook 'org-mode-hook (lambda ()
(turn-on-auto-fill)))
#+END_SRC
Revert orgzly buffers on agenda refresh
#+BEGIN_SRC emacs-lisp
(advice-add 'org-agenda-redo :before 'org-revert-all-orgzly-buffers)
#+END_SRC
*** Agenda
Set the canonical binding for the agenda
#+BEGIN_SRC emacs-lisp
@ -411,6 +415,27 @@
(tags-todo "5m")
(tags-todo "20m")))))
#+END_SRC
*** Reverting stuff from orgzly
#+BEGIN_SRC emacs-lisp
(defun org-revert-all-orgzly-buffers ()
"Revert all Org buffers that are sitting in orgzly
Prompt for confirmation when there are unsaved changes. Be sure
you know what you are doing before letting this function
overwrite your changes."
(interactive)
(message "Reverting Orgzly buffers…")
(save-excursion
(save-window-excursion
(dolist (b (buffer-list))
(when (and (with-current-buffer b (derived-mode-p 'org-mode))
(with-current-buffer b buffer-file-name)
(with-current-buffer b (string-match-p "orgzly" default-directory)))
(with-current-buffer b (print buffer-file-name))
(pop-to-buffer-same-window b)
(revert-buffer t 'no-confirm)))
(when (and (featurep 'org-id) org-id-track-globally)
(org-id-locations-load)))))
#+END_SRC
*** Capture
Set default keybinding
#+BEGIN_SRC emacs-lisp

Loading…
Cancel
Save