From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp0 ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms11 with LMTPS
	id YDvFJgeGGWDEVAAA0tVLHw
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 02 Feb 2021 17:04:07 +0000
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp0 with LMTPS
	id yLCWIgeGGWCTWAAA1q6Kng
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 02 Feb 2021 17:04:07 +0000
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 719229404C6
	for <larch@yhetil.org>; Tue,  2 Feb 2021 17:04:07 +0000 (UTC)
Received: from localhost ([::1]:39486 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	id 1l6z5y-0007C0-89
	for larch@yhetil.org; Tue, 02 Feb 2021 12:04:06 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:59922)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rwl@fastmail.com>) id 1l6z1m-0006Hq-IJ
 for emacs-orgmode@gnu.org; Tue, 02 Feb 2021 11:59:46 -0500
Received: from forward3-smtp.messagingengine.com ([66.111.4.237]:58399)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rwl@fastmail.com>) id 1l6z1i-00062w-Ok
 for emacs-orgmode@gnu.org; Tue, 02 Feb 2021 11:59:46 -0500
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailforward.nyi.internal (Postfix) with ESMTP id CA03E19413DB;
 Tue,  2 Feb 2021 11:59:40 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Tue, 02 Feb 2021 11:59:40 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Swpx3d
 dOVsgIbEljZwV19qKRILY0/FJJkh95I9NumDA=; b=jz6Re3F1c7Kitub3DvhssS
 JLAAN7SvfnB/IXKGiC4mop5Y66FZIErZcyI49PUXBrdoNtA93+Q+n1d47XJXA7Yj
 GNCxA6oJ1shjD5HIsLNDInLAP9xhInwmtyJMNNED9NtKf9LQWHjoax6rHVHS+iOt
 nr4wH1FVmx2a2dxvNCDVdP0DuBOq9seTeU9BEJdFezw0Qc58qzRoULeszCxotGA9
 KvtjIoiqjxfFlh1UFFdaYwbbOXC6m1SxKMljn7fa13oumDActnIsnRiekmxt35pb
 QBIS3WN7Wa9ul7P0c5awWmYI2GTO7ipRt7vkYAnCHcmB38awPVvm3Wpl5y3hZR+g
 ==
X-ME-Sender: <xms:_IQZYDhOtOMGrnErAbCcA9YNiQy9lR1ACOZO_3KRe67WugGXp0KKiw>
 <xme:_IQZYAC6oeWFv7KHcF6BC8qKX5BOeOBAx3E0e-oGXUstlfjmsMil4MOAI1vFyPzGR
 AzHmG1HQHeFqwNbSg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgedtgdelhecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpeftihgthhgrrhgu
 ucfnrgifrhgvnhgtvgcuoehrihgthhgrrhgurdhlrgifrhgvnhgtvgesuhhnihdqthhuvg
 gsihhnghgvnhdruggvqeenucggtffrrghtthgvrhhnpefhjeehueejlefgvdeikeekgeet
 hfegkeekvdegleejvdetjeehhffffeetgefgleenucfkphepgeeirdduudegrddugeeird
 dvfeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep
 rhiflhesfhgrshhtmhgrihhlrdgtohhm
X-ME-Proxy: <xmx:_IQZYDGKWIKcI7LheLgU1xJ7hAmglWlzanf6lI58OeVgzKxoaNgYcg>
 <xmx:_IQZYARJ6jNydWRe0xKHQU17Fwu2glBj-mkobVujXzJtke-U32btKQ>
 <xmx:_IQZYAxzTpzK9NNezg10tf8FoXQVv23p0jGDzkS6-XntvD8AoiQLpw>
 <xmx:_IQZYNssI17S-TIxjOtBTICEAHOUPo0dEF6Yr-u_UI0Sloh7zHAG5w>
Received: from aquinas (dynamic-046-114-146-238.46.114.pool.telefonica.de
 [46.114.146.238])
 by mail.messagingengine.com (Postfix) with ESMTPA id 53A2F24005A;
 Tue,  2 Feb 2021 11:59:40 -0500 (EST)
Received: from rwl by aquinas with local (Exim 4.92)
 (envelope-from <rwl@fastmail.com>)
 id 1l6z1c-0006zm-Nz; Tue, 02 Feb 2021 17:59:36 +0100
From: Richard Lawrence <richard.lawrence@uni-tuebingen.de>
To: Kyle Meyer <kyle@kyleam.com>
Subject: Re: [PATCH] capture: Fix handling of time range for :time-prompt
In-Reply-To: <87v9bbxeq0.fsf@kyleam.com>
References: <878s8pll2g.fsf@kyleam.com> <87a6spz7b5.fsf@aquinas>
 <87v9bbxeq0.fsf@kyleam.com>
Date: Tue, 02 Feb 2021 17:59:36 +0100
Message-ID: <87lfc6xv5z.fsf@aquinas>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: neutral client-ip=66.111.4.237; envelope-from=rwl@fastmail.com;
 helo=forward3-smtp.messagingengine.com
X-Spam_score_int: 20
X-Spam_score: 2.0
X-Spam_bar: ++
X-Spam_report: (2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001,
 SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Cc: emacs-orgmode@gnu.org
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
X-Migadu-Spam-Score: -4.00
Authentication-Results: aspmx1.migadu.com;
	none
X-Migadu-Queue-Id: 719229404C6
X-Spam-Score: -4.00
X-Migadu-Scanner: scn1.migadu.com
X-TUID: lZ/2ApkHRexP

Kyle Meyer <kyle@kyleam.com> writes:

> Pushed (3e64d3475).

Thank you!

>> 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
> range?
>
>   (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
report back.

-- 
Best,
Richard