org-agenda.el (org-agenda-insert-diary-make-new-entry): Fix ordering

* org-agenda.el (org-agenda-insert-diary-make-new-entry):
Fix ordering.

TINYCHANGE
This commit is contained in:
Nikolai Weibull 2014-07-28 16:22:04 +02:00 committed by Bastien Guerry
parent 3d7a9f8517
commit 5512bedee6
1 changed files with 7 additions and 6 deletions

View File

@ -9486,20 +9486,21 @@ a timestamp can be added there."
(if org-adapt-indentation (org-indent-to-column 2))) (if org-adapt-indentation (org-indent-to-column 2)))
(defun org-agenda-insert-diary-make-new-entry (text) (defun org-agenda-insert-diary-make-new-entry (text)
"Make a new entry with TEXT as the first child of the current subtree. "Make new entry as last child of current entry.
Position the point in the line right after the new heading so Add TEXT as headline, and position the cursor in the second line so that
that a timestamp can be added there." a timestamp can be added there."
(let ((org-show-following-heading t) (let ((org-show-following-heading t)
(org-show-siblings t) (org-show-siblings t)
(org-show-hierarchy-above t) (org-show-hierarchy-above t)
(org-show-entry-below t) (org-show-entry-below t)
(has-children (save-excursion (org-goto-first-child)))
col) col)
(outline-next-heading)
(org-back-over-empty-lines) (org-back-over-empty-lines)
(or (looking-at "[ \t]*$") (or (looking-at "[ \t]*$")
(progn (insert "\n") (backward-char 1))) (progn (insert "\n") (backward-char 1)))
(org-insert-heading nil t) (org-insert-heading 16 t)
(org-do-demote) (unless has-children
(org-do-demote))
(setq col (current-column)) (setq col (current-column))
(insert text "\n") (insert text "\n")
(if org-adapt-indentation (org-indent-to-column col)) (if org-adapt-indentation (org-indent-to-column col))