org-agenda: Fix order when writing to an ".org" file

* lisp/org-agenda.el (org-agenda-write): Write headings in proper
  order.

`org-paste-subtree' leaves point before inserted text, so there is no
need to reverse contents.

http://permalink.gmane.org/gmane.emacs.orgmode/89867
This commit is contained in:
Nicolas Goaziou 2014-08-25 15:19:24 +02:00
parent 896fa6d1f7
commit e191a76ddd

View file

@ -3352,7 +3352,7 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write."
content)))
(find-file file)
(erase-buffer)
(mapcar (lambda (s) (org-paste-subtree 1 s)) (reverse content))
(dolist (s content) (org-paste-subtree 1 s))
(write-file file)
(kill-buffer (current-buffer))
(message "Org file written to %s" file)))