From be39290a825b5f3396f447c6be783f327795b35b Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Mon, 24 Nov 2025 09:47:00 -0500 Subject: [PATCH] Simplify updating orgzly buffers --- global.org | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/global.org b/global.org index 50c72f7..699a3ca 100644 --- a/global.org +++ b/global.org @@ -1904,19 +1904,22 @@ (message "Reverting Orgzly buffers…") ; pull from remote (let ((default-directory "~/clones/orgzly")) - (or (eq 0 (shell-command "git pull origin master")) (call-interactively #'magit-status))) - (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))) - (pop-to-buffer-same-window b) - (revert-buffer t 'no-confirm))))) - + (or (eq 0 (shell-command "git pull origin master")) + (call-interactively #'magit-status))) + + (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 + (revert-buffer t 'no-confirm)))) + (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) #+end_src + Use gac #+begin_src emacs-lisp (require 'git-auto-commit-mode)