org-agenda.el: Bugfix for `org-agenda-write'.

* org-agenda.el (org-agenda-write): Fix bug when writing
agenda to an external file while `org-agenda-sticky' is
non-nil.
This commit is contained in:
Bastien Guerry 2012-08-01 16:32:36 +02:00
parent a88dae9236
commit b771d4b05b
1 changed files with 3 additions and 1 deletions

View File

@ -3012,7 +3012,9 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write."
(save-buffer 0)
(kill-buffer (current-buffer))
(message "Plain text written to %s" file))))))))
(set-buffer (or agenda-bufname org-agenda-buffer-name)))
(set-buffer (or agenda-bufname
(and (called-interactively-p 'any) (buffer-name))
org-agenda-buffer-name)))
(when open (org-open-file file)))
(defvar org-agenda-tag-filter-overlays nil)