From: Richard Lawrence <email@example.com>
To: Kyle Meyer <firstname.lastname@example.org>
Subject: Re: [PATCH] capture: Fix handling of time range for :time-prompt
Date: Tue, 02 Feb 2021 17:59:36 +0100 [thread overview]
Message-ID: <87lfc6xv5z.fsf@aquinas> (raw)
Kyle Meyer <email@example.com> writes:
> Pushed (3e64d3475).
>> As far as I can tell, that is not fully possible today, even with this
>> patch. The reason is that time *range* information entered at the prompt
>> generated by :time-prompt gets thrown away. The reason for *that* is
>> that org-read-date is called with t as its to-time argument (the second
>> argument), so that the date is returned in Emacs' internal time
>> representation, which doesn't represent ranges.
> Hmm. Is it really about the TO-TIME argument? If org-read-date is
> called with TO-TIME as nil, doesn't it still throw away the end of the
> (let ((org-time-was-given nil)
> (org-end-time-was-given nil))
> (org-read-date nil nil nil "Date for tree entry:"))
> ;; enter "3pm-4pm" => "2021-02-01 15:00"
> Or, actually, it stores the end in org-end-time-was-given, but it does
> that regardless of the TO-TIME argument.
Ah, that's interesting, thanks for pointing it out. I thought I had
checked to see if org-end-time-was-given had a value after org-read-date
gets called for a capture :time-prompt, but now I see that of course
that wouldn't work without the surrounding let binding...
OK, so with your patch, the way is clear to stick this value in
org-capture-plist and make use of it when filling %T and friends in
templates. I'll see if I can come up with a patch to do that, and
prev parent reply other threads:[~2021-02-02 17:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-24 10:42 Bug: incorrect timestamps with :time-prompt and datetrees Richard Lawrence
2020-12-24 12:07 ` Richard Lawrence
2021-01-06 12:16 ` Richard Lawrence
2021-01-12 8:41 ` [PATCH] " Richard Lawrence
2021-01-18 6:35 ` Bug: " Kyle Meyer
2021-01-19 2:25 ` [PATCH] capture: Fix handling of time range for :time-prompt Kyle Meyer
2021-01-31 11:15 ` Richard Lawrence
2021-02-02 4:42 ` Kyle Meyer
2021-02-02 16:59 ` Richard Lawrence [this message]
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).