0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 20:07:46 +00:00

Fix interactive timestamp entry in capture templates

* lisp/org-capture.el: (org-capture-fill-template) Fix interactive
  timestamp entry to match the behavior of org-time-stamp. This fixes
  a bug related to the %^t and %^u template escapes which resulted in
  incorrect timestamps (<2017-10-06 Fri-12:00>). The difference
  between %^t and %^T now corresponds to the difference between
  org-time-stamp called without and with a prefix argument.
This commit is contained in:
Matt Lundin 2017-10-06 09:50:05 -05:00 committed by Nicolas Goaziou
parent 710a3d1131
commit ce536f6375

View file

@ -1792,11 +1792,10 @@ The template may still contain \"%?\" for cursor positioning."
(let* ((upcase? (equal (upcase key) key)) (let* ((upcase? (equal (upcase key) key))
(org-end-time-was-given nil) (org-end-time-was-given nil)
(time (org-read-date upcase? t nil prompt))) (time (org-read-date upcase? t nil prompt)))
(let ((org-time-was-given upcase?)) (org-insert-time-stamp
(org-insert-time-stamp time (or org-time-was-given upcase?)
time org-time-was-given (member key '("u" "U"))
(member key '("u" "U")) nil nil (list org-end-time-was-given))))
nil nil (list org-end-time-was-given)))))
(`nil (`nil
(push (org-completing-read (push (org-completing-read
(concat (or prompt "Enter string") (concat (or prompt "Enter string")