diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index b83c33158..5f7c9ac80 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -9505,11 +9505,7 @@ a timestamp can be added there." (org-do-demote) (setq col (current-column)) (insert text) - (forward-line) - (when (org-looking-at-p org-planning-line-re) (forward-line)) - (when (looking-at org-property-drawer-re) - (goto-char (match-end 0)) - (forward-line)) + (org-end-of-meta-data) (unless (bolp) (insert "\n")) (when org-adapt-indentation (org-indent-to-column col)) (let ((org-show-following-heading t) diff --git a/lisp/org.el b/lisp/org.el index 26c3603e5..9a86ee131 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -13563,13 +13563,7 @@ When optional argument CREATE is non-nil, the function creates a drawer to store notes, if necessary. Returned position ignores narrowing." (org-with-wide-buffer - (org-back-to-heading t) - ;; Skip planning info and property drawer. - (forward-line) - (when (org-looking-at-p org-planning-line-re) (forward-line)) - (when (looking-at org-property-drawer-re) - (goto-char (match-end 0)) - (forward-line)) + (org-end-of-meta-data) (let ((end (if (org-at-heading-p) (point) (save-excursion (outline-next-heading) (point)))) (drawer (org-log-into-drawer)))