From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 KKOoGGprwl5xUAAA0tVLHw (envelope-from ) for ; Mon, 18 May 2020 11:03:06 +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 8AJ7FGprwl5TPgAA1q6Kng (envelope-from ) for ; Mon, 18 May 2020 11:03:06 +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 A7AEF940039 for ; Mon, 18 May 2020 11:03:05 +0000 (UTC) Received: from localhost ([::1]:35288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jadXz-0002Wb-QQ for larch@yhetil.org; Mon, 18 May 2020 07:03:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jadUw-0002VV-3t for emacs-orgmode@gnu.org; Mon, 18 May 2020 06:59:54 -0400 Received: from mout.web.de ([212.227.17.12]:46651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jadUt-0002aJ-8V for emacs-orgmode@gnu.org; Mon, 18 May 2020 06:59:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1589799588; bh=1TeSzN11qgc0DVOlpe7f0uEzUv6dhOuPF2h1W/8AqMw=; h=X-UI-Sender-Class:From:To:Subject:Date; b=XIr5AphNyc5syh3YMeAfTlfZ5hdIUNpfxGUaUN+fETykc4VmzRvfSA9TRpCIs/kzF ZuwbIN57Xa8mhBmiL8zbxwLUb8riXAgqIRv3s4ZLWbqbTXNAPOnF1L1U24DXYvoUFV kjFwdh5QGcDMhlK+SW1i1e87D/RW7hWwJc8zIOrM= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [37.228.141.26] ([37.228.141.26]) by web-mail.web.de (3c-app-webde-bap63.server.lan [172.19.172.159]) (via HTTP); Mon, 18 May 2020 12:59:47 +0200 MIME-Version: 1.0 Message-ID: From: "Nils Schween" To: emacs-orgmode@gnu.org Subject: Capture Template Diary Entry: file+datetree+prompt use the prompted timestamp including the time when time is specified Content-Type: text/plain; charset=UTF-8 Date: Mon, 18 May 2020 12:59:47 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:E8d7eIY8Q+Nq/SGhtMSYKUGuXrf9uWwjskHdnxhRyg5BHHdbEgyTjMOnFIXugFOMAWK88 VN4OvTPhAHNd8ElYjG6gMqYnSCTdm5QejJ6KlWgy2+PCtgcCvEf/lgPdEDbIuvcr+ZA3jn1XCJWb AN3Bup5OjeC8U4kitw9dBC92QaUrAVrcD6lc6yncFFOAY2Hd8ify2Nd4z50qqT+ABzMOrlCEVQPD xRpxeJpkYlJYpWaDztsJ7EAdpHfo9sEUFEWDFwiLGkicXLbciT/lPfb5kHiKZU6MlAqF2VhwERaJ hw= X-UI-Out-Filterresults: notjunk:1;V03:K0:vd+sEPic+Ug=:qGKhS2Lr+pmfqRXSR7fYRg VgvFPzddtF21e3Q2hlSx7179+/zBy4rbK69rZOIePsIqcJKb2SQEs9/zmhxRpmKAUfpnZ/h5R jKkv7LNURo9pS0j4yVB0Vm6ycMCzqTEfpnvwcEz3Ovvv4wUirC807hnPAmTu8pdDMX2LrXHCd ZXlwbirWzZF13cIpfQvv+MlxMV9neQ0yGDpz1Yay4zVkDlMgG74Yu/NTGlPVQOYSrfnQDKjCw sSm42O05nI4S78VSaD/PTx0Sa2K9jTt7W/rPoYXgfvUOt9875EpGuiR/lCCaBA6LvwXYQR8qK 3NdhSQmi6XAHVdhz2EUIoqskGhmtNTG775A46sh8y3dvFSopHhaxYFVgL29xBV7fqxgN6MNSx Q6mlx42rhq/bnXCN5U0W0DFkEW69zyLxEm32D6WSO7RiLFklnpATGSLY1ZFlu+FguvvSqTOLi FeOCpt25ILoJT5d8xbGSAsxhU6eREuo6yUgJVdemKcUEfhXeGP1Q72N00XaIcie3CpdSbNllZ EZ0d8C2/V1oVB6mumodyuV2ws329ZHYWqsPdOXyCPLlS10s8WWgGPkdYpTT2nzR5ZglYLJcu9 1PsvyIN458QGyAUlNt6qBSRReSWXcuwfb339WZS6sFQpBYTt9ZJyiQeHoFIEzc/AaOaVbD5+h AcXa5re2B7UG1gh08Bm25GxCPEFzffNoUZf3rCT0GDDrDOJnpnCXra9lXlfg7fWFEjM8= Received-SPF: pass client-ip=212.227.17.12; envelope-from=nils.schween@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/18 06:59:48 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=web.de header.s=dbaedf251592 header.b=XIr5AphN; 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-Spam-Score: -0.71 X-TUID: dMXac/xa8UIJ Dear members of the org-mode mailing list, a week ago I spent some time to set up a capture template to directly write appointments to my calendar file (i.e. to write diary entries). It looks as follows: ("d" "Diary entry" entry (file+datetree+prompt "~/MPIK-Nextcloud/emacs/.org/kalender.org") "* %i%?\n %T") And it works as expected: When calling the capture template, I am prompted for a date and I can also type a time, and on saving everything is stored at the correct location in the datetree. Perfect. But in case I do not enter a time, 00:00 is inserted. This is unfortunate. Okay, I can replace "%T" in the template with "%t", but then any specification of time is ignored. Instead, I would love to mimic the behaviour of the function "org-time-stamp". Calling it prompts for a date, and if I do not specify a time, only the date is inserted. In case I specify a time or a range (i.e. 10:00-12:00) the timestamp is supplemented with this additional information. The use-case is the following: Some of my appointments last a whole day, and others start at a specified time and some of them last e.g. only two hours. To capture all these cases, I would need a template expansion inserting the timestamp as I entered it when prompted, i.e. if a specify a time, it includes it and if not it does not. Of course, this should also be true for e.g. (10:00-12:00). I tried a lot to get the desired behaviour by testing variants of the following combination of org-mode functions and variables. %(org-insert-time-stamp (org-read-date nil t org-read-date-final-answer) t) I was not able to produce what I wanted. Does anyone have a workaround or an idea how I could implement the described and wished behaviour? Thanks. With best regards, Nils