瀏覽代碼

Fix bug in org-capture file+datetree+promt target type

* lisp/org-capture.el (org-capture-set-target-location): Set the capture
default time also to the prompt time.

In the file+datetree+promt target type, the user is being asked for a
date, where to file an entry.  In the template, there can the escape
placeholders for active and inactive time stamps.  So far, these were
filled with todays date.  This patch changes this behavior, so that
also at %t and %u escaped, the date entered at the prompt will be
used.

Reported by Erik Hetzner.
Carsten Dominik 13 年之前
父節點
當前提交
acfd6ff3bc
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lisp/org-capture.el

+ 2 - 1
lisp/org-capture.el

@@ -778,7 +778,8 @@ already gone.  Any prefix argument will be passed to the refile command."
 	    (let ((prompt-time (org-read-date
 				nil t nil "Date for tree entry:"
 				(current-time))))
-	      (org-capture-put :prompt-time prompt-time)
+	      (org-capture-put :prompt-time prompt-time
+			       :default-time prompt-time)
 	      (time-to-days prompt-time)))
 	   (t
 	    ;; current date, possible corrected for late night workers