summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-14 16:12:43 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-01-14 16:12:43 +0100
commitbed17f1bb505dd6ecf80b44bf1ef267d45efb206 (patch)
tree9c8448a945a8e334c65f9d22c8e8fd4cfcdd7240
parent88486fdce0b5fe69d26c712798f95be00e3c6a46 (diff)
downloadorg-mode-bed17f1bb505dd6ecf80b44bf1ef267d45efb206.tar.gz
org-mobile: Fix `org-mobile-push' with stick agendas
* lisp/org-mobile.el (org-mobile-push): Do not move back to non-sticky agendas once called. Reported-by: Ian Dunn <dunni@gnu.org> <http://permalink.gmane.org/gmane.emacs.orgmode/111334>
-rw-r--r--lisp/org-mobile.el59
1 files changed, 25 insertions, 34 deletions
diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 2c36216..d0eeee8 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -308,40 +308,31 @@ Also exclude files matching `org-mobile-files-exclude-regexp'."
This will create the index file, copy all agenda files there, and also
create all custom agenda views, for upload to the mobile phone."
(interactive)
- (let ((a-buffer (get-buffer org-agenda-buffer-name)))
- (let ((org-agenda-curbuf-name org-agenda-buffer-name)
- (org-agenda-buffer-name "*SUMO*")
- (org-agenda-tag-filter org-agenda-tag-filter)
- (org-agenda-redo-command org-agenda-redo-command))
- (save-excursion
- (save-restriction
- (save-window-excursion
- (run-hooks 'org-mobile-pre-push-hook)
- (org-mobile-check-setup)
- (org-mobile-prepare-file-lists)
- (message "Creating agendas...")
- (let ((inhibit-redisplay t)
- (org-agenda-files (mapcar 'car org-mobile-files-alist)))
- (org-mobile-create-sumo-agenda))
- (message "Creating agendas...done")
- (org-save-all-org-buffers) ; to save any IDs created by this process
- (message "Copying files...")
- (org-mobile-copy-agenda-files)
- (message "Writing index file...")
- (org-mobile-create-index-file)
- (message "Writing checksums...")
- (org-mobile-write-checksums)
- (run-hooks 'org-mobile-post-push-hook))))
- (setq org-agenda-buffer-name org-agenda-curbuf-name
- org-agenda-this-buffer-name org-agenda-curbuf-name))
- (redraw-display)
- (when (buffer-live-p a-buffer)
- (if (not (get-buffer-window a-buffer))
- (kill-buffer a-buffer)
- (let ((cw (selected-window)))
- (select-window (get-buffer-window a-buffer))
- (org-agenda-redo)
- (select-window cw)))))
+ (let* ((agenda-base-name org-agenda-buffer-name)
+ (agenda-this-name (or org-agenda-this-buffer-name agenda-base-name))
+ (org-agenda-buffer-name "*SUMO*")
+ (org-agenda-tag-filter org-agenda-tag-filter)
+ (org-agenda-redo-command org-agenda-redo-command))
+ (save-excursion
+ (save-restriction
+ (save-window-excursion
+ (run-hooks 'org-mobile-pre-push-hook)
+ (org-mobile-check-setup)
+ (org-mobile-prepare-file-lists)
+ (message "Creating agendas...")
+ (let ((inhibit-redisplay t)
+ (org-agenda-files (mapcar 'car org-mobile-files-alist)))
+ (org-mobile-create-sumo-agenda))
+ (message "Creating agendas...done")
+ (org-save-all-org-buffers) ; to save any IDs created by this process
+ (message "Copying files...")
+ (org-mobile-copy-agenda-files)
+ (message "Writing index file...")
+ (org-mobile-create-index-file)
+ (message "Writing checksums...")
+ (org-mobile-write-checksums)
+ (run-hooks 'org-mobile-post-push-hook)))))
+ (org-agenda-maybe-redo)
(message "Files for mobile viewer staged"))
(defvar org-mobile-before-process-capture-hook nil