From 5512bedee6d48a0a2bc4250cc945d404ee94d159 Mon Sep 17 00:00:00 2001 From: Nikolai Weibull Date: Mon, 28 Jul 2014 16:22:04 +0200 Subject: [PATCH] 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 --- lisp/org-agenda.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index f24e1f66a..377dad397 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -9486,20 +9486,21 @@ a timestamp can be added there." (if org-adapt-indentation (org-indent-to-column 2))) (defun org-agenda-insert-diary-make-new-entry (text) - "Make a new entry with TEXT as the first child of the current subtree. -Position the point in the line right after the new heading so -that a timestamp can be added there." + "Make new entry as last child of current entry. +Add TEXT as headline, and position the cursor in the second line so that +a timestamp can be added there." (let ((org-show-following-heading t) (org-show-siblings t) (org-show-hierarchy-above t) (org-show-entry-below t) + (has-children (save-excursion (org-goto-first-child))) col) - (outline-next-heading) (org-back-over-empty-lines) (or (looking-at "[ \t]*$") (progn (insert "\n") (backward-char 1))) - (org-insert-heading nil t) - (org-do-demote) + (org-insert-heading 16 t) + (unless has-children + (org-do-demote)) (setq col (current-column)) (insert text "\n") (if org-adapt-indentation (org-indent-to-column col)) -- 2.11.4.GIT