Browse Source

org-mobile: Save agenda files before pushing

* lisp/org-mobile.el (org-mobile-push): Save agenda files before
  pushing.

Fixes: 19448
Nicolas Goaziou 1 year ago
parent
commit
c0ea20aab7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lisp/org-mobile.el

+ 5 - 0
lisp/org-mobile.el

@@ -311,6 +311,11 @@ create all custom agenda views, for upload to the mobile phone."
   (let ((org-agenda-buffer-name "*SUMO*")
 	(org-agenda-tag-filter org-agenda-tag-filter)
 	(org-agenda-redo-command org-agenda-redo-command))
+    ;; Offer to save agenda-related buffers before pushing, preventing
+    ;; "Non-existent agenda file" prompt for lock files (see #19448).
+    (let ((agenda-buffers (org-buffer-list 'agenda)))
+      (save-some-buffers nil
+			 (lambda () (memq (current-buffer) agenda-buffers))))
     (save-excursion
       (save-restriction
 	(save-window-excursion