Simplify updating orgzly buffers

master
Jacopo De Simoi 8 months ago
parent da1502871f
commit be39290a82
  1. 15
      global.org

@ -1904,19 +1904,22 @@
(message "Reverting Orgzly buffers…") (message "Reverting Orgzly buffers…")
; pull from remote ; pull from remote
(let ((default-directory "~/clones/orgzly")) (let ((default-directory "~/clones/orgzly"))
(or (eq 0 (shell-command "git pull origin master")) (call-interactively #'magit-status))) (or (eq 0 (shell-command "git pull origin master"))
(save-excursion (call-interactively #'magit-status)))
(save-window-excursion
(dolist (b (buffer-list)) (dolist (b (buffer-list))
(when (and (with-current-buffer b (derived-mode-p 'org-mode)) (when (and (with-current-buffer b (derived-mode-p 'org-mode))
(with-current-buffer b buffer-file-name) (with-current-buffer b buffer-file-name)
(with-current-buffer b (string-match-p "orgzly" default-directory))) (with-current-buffer b (string-match-p "orgzly" default-directory)))
(pop-to-buffer-same-window b) (with-current-buffer b
(revert-buffer t 'no-confirm))))) (revert-buffer t 'no-confirm))))
(org-agenda-redo-all)
(org-agenda-redo-all)) (org-agenda-redo-all))
;; I do not understand why, but I need to run it twice
(define-key org-agenda-mode-map (kbd "Z") 'org-revert-all-orgzly-buffers) (define-key org-agenda-mode-map (kbd "Z") 'org-revert-all-orgzly-buffers)
#+end_src #+end_src
Use gac Use gac
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'git-auto-commit-mode) (require 'git-auto-commit-mode)

Loading…
Cancel
Save