From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id N7LCAK+E5F+sRQAA0tVLHw (envelope-from ) for ; Thu, 24 Dec 2020 12:08:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id EDOoN66E5F8tCAAAbx9fmQ (envelope-from ) for ; Thu, 24 Dec 2020 12:08:14 +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 DA89F940105 for ; Thu, 24 Dec 2020 12:08:12 +0000 (UTC) Received: from localhost ([::1]:46306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ksPPf-0005SL-RE for larch@yhetil.org; Thu, 24 Dec 2020 07:08:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksPPI-0005RW-5x for emacs-orgmode@gnu.org; Thu, 24 Dec 2020 07:07:48 -0500 Received: from wforward4-smtp.messagingengine.com ([64.147.123.34]:56219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ksPPG-000629-2l for emacs-orgmode@gnu.org; Thu, 24 Dec 2020 07:07:47 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailforward.west.internal (Postfix) with ESMTP id 8363A13D5 for ; Thu, 24 Dec 2020 07:07:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 24 Dec 2020 07:07:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm1; bh=jbZGNz BAOify+GxTEOsvebXb9c4FeHGwi1aHjUmem/g=; b=AJ86+WcvnneA7TH29Y94F1 eKrXJhnp8JRJK3cSfmTivBNq12pY+9TQ+1zXIppQTEfD/PZHzsqqbwV5xSG5JPqS CxQvfk10DgWpNuma+5fbjqV2/1Z7JcELRjsjRrTdbiYKhiN6NFTw1M0TQggmJp/k wJlBPF7UkzDN3dLfhkDRLDNqAFVA0EynfMsKvSw/rRl3oW5NneU1Ddl6gcc3EFdl vW5K5QX6dMBVEiG4sv1UYLUqRGNuizCtrhCWtg9zy60F78eTq8FerRNOPRd/nl/f S3tfKA9YZPH7fkmMu2M3H1CBDmBkTqNaBDyykioxcAJx2MGKd0aBr3bEKdElvcZA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtledgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffujghffffkgggtsehttdertd dttddtnecuhfhrohhmpeftihgthhgrrhguucfnrgifrhgvnhgtvgcuoehrihgthhgrrhgu rdhlrgifrhgvnhgtvgesuhhnihdqthhuvggsihhnghgvnhdruggvqeenucggtffrrghtth gvrhhnpefhjeehueejlefgvdeikeekgeethfegkeekvdegleejvdetjeehhffffeetgefg leenucfkphepiedvrddvudeirddvtddurdduiedvnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprhiflhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from aquinas (aftr-62-216-201-162.dynamic.mnet-online.de [62.216.201.162]) by mail.messagingengine.com (Postfix) with ESMTPA id B86BD24005B for ; Thu, 24 Dec 2020 07:07:43 -0500 (EST) Received: from rwl by aquinas with local (Exim 4.92) (envelope-from ) id 1ksPPB-0003Qt-Q9 for emacs-orgmode@gnu.org; Thu, 24 Dec 2020 13:07:41 +0100 From: Richard Lawrence To: emacs-orgmode@gnu.org Subject: Re: Bug: incorrect timestamps with :time-prompt and datetrees In-Reply-To: <87h7obh4ct.fsf@aquinas> References: <87h7obh4ct.fsf@aquinas> Date: Thu, 24 Dec 2020 13:07:41 +0100 Message-ID: <87eejfh0fm.fsf@aquinas> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: neutral client-ip=64.147.123.34; envelope-from=rwl@fastmail.com; helo=wforward4-smtp.messagingengine.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.53 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=AJ86+Wcv; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: DA89F940105 X-Spam-Score: -0.53 X-Migadu-Scanner: scn1.migadu.com X-TUID: mmcybgtw0eg0 Richard Lawrence writes: > This is org 9.4 running from maint (commit ab00524fc). I spent a while > stepping through org-capture and org-read-date but haven't found the > problem yet. I suspect this snippet from a cond form in the middle of > org-capture-set-target-location: > > #+begin_src > ((string-match "\\([^ ]+\\)-[^ ]+[ ]+\\(.*\\)" > org-read-date-final-answer) > ;; Replace any time range by its start. > (apply #'encode-time > (org-read-date-analyze > ;; it looks to me like this is maybe sending the wrong value > ;; into org-read-date-analyze: > (replace-match "\\1 \\2" nil nil > org-read-date-final-answer) > > #+end_src I can now confirm that this is the problem. It looks like what is happening here is that the regex is meant to match a time range, but ends up matching the date: thus a string like "12-31 13:00" gets mangled to "12 13:00" and sent into org-read-date-analyze. If I comment out this branch of the cond form, and enter "12-31 13:00" at the org-read-date-prompt, then both the timestamp and the location in the datetree are correct. So I guess the solution is...a better regex is needed to cause this branch to fire only in the intended case, namely, a time range. Should it be checking for "am"/"pm" or ":" or similar? Otherwise it seems impossible to distinguish a date specification like "11-12" from a time range. -- Best, Richard