diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-08-21 23:31:23 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-08-21 23:31:23 +0200 |
commit | a834a5939fd7fa9b7184ebc0a4587a72916f907f (patch) | |
tree | 029f715231733482839bf3f568f99d4a86c9ffa9 | |
parent | 6d3c988561dd1648b9d497aeb3901dafa00312d7 (diff) | |
download | org-mode-a834a5939fd7fa9b7184ebc0a4587a72916f907f.tar.gz |
org-capture: Fix datetree capture
* lisp/org-capture.el (org-capture-set-target-location): Fix
file+datetree capture with non-nil `org-datetree-add-timestamp.
Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/100300>
-rw-r--r-- | lisp/org-capture.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el index bfdb475..ee94ee9 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -929,7 +929,12 @@ Store them in the capture property list." (time-to-days prompt-time))) (t ;; current date, possibly corrected for late night workers - (org-today)))))) + (org-today))))) + ;; If `org-datetree-add-timestamp' is non-nil, point is not + ;; located on a headline. However `file+datetree' expects + ;; a node where to paste captured tree. Thus, we make sure to + ;; move to day heading. + (org-back-to-heading t)) ((eq (car target) 'file+function) (set-buffer (org-capture-target-buffer (nth 1 target))) |