Fix `org-log-beginning' on empty entries

* lisp/org.el (org-log-beginning): Check for the need to insert
  a drawer in all cases.

Suggested-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/93538>
This commit is contained in:
Nicolas Goaziou 2014-12-20 21:59:51 +01:00
parent 685e4b733a
commit 442216871a
1 changed files with 29 additions and 29 deletions

View File

@ -13630,8 +13630,8 @@ narrowing."
(when (looking-at org-property-drawer-re)
(goto-char (match-end 0))
(forward-line))
(if (org-at-heading-p) (point)
(let ((end (save-excursion (outline-next-heading) (point)))
(let ((end (if (org-at-heading-p) (point)
(save-excursion (outline-next-heading) (point))))
(drawer (org-log-into-drawer)))
(cond
(drawer
@ -13658,7 +13658,7 @@ narrowing."
(progn (goto-char (match-end 0))
(re-search-forward org-property-end-re end t)))
(forward-line)))))
(if (bolp) (point) (line-beginning-position 2)))))
(if (bolp) (point) (line-beginning-position 2))))
(defun org-add-log-setup (&optional purpose state prev-state findpos how extra)
"Set up the post command hook to take a note.