From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wEi4FieFAWJQQQEAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 21:46:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kBmDDyeFAWIeAAEAG6o9tA (envelope-from ) for ; Mon, 07 Feb 2022 21:46:31 +0100 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 EFC9C2F849 for ; Mon, 7 Feb 2022 21:46:24 +0100 (CET) Received: from localhost ([::1]:54848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHAu0-00032V-0s for larch@yhetil.org; Mon, 07 Feb 2022 15:46:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHAqD-0001fg-C6 for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 15:42:29 -0500 Received: from mx03.uni-tuebingen.de ([134.2.5.213]:39092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHAq9-0004oe-Gn for emacs-orgmode@gnu.org; Mon, 07 Feb 2022 15:42:27 -0500 Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com [66.111.4.227]) by mx03.uni-tuebingen.de (Postfix) with ESMTPSA id 4C29820C5ECB; Mon, 7 Feb 2022 21:41:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mx03.uni-tuebingen.de 4C29820C5ECB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uni-tuebingen.de; s=20211202test; t=1644266509; bh=QIllkc3NVyz50Sn0f+j8RliHHa4ay+h3rzOA2isdlSA=; h=From:To:Subject:In-Reply-To:References:Date:From; b=tZ0JfZKyCbt7GSQwFIJb6EDMOwZtKYogWzsG4XQRgsLfKqi+jqdJySUlWr5duF+oD 4lBB3IOnLOi52gEEupS2WtdmJhqAY0j3v2jgcTqsXpyNov+SPiD3t1mpxWSyOj46yA h0pbLWoEFupA0OL8f96VSXiswFd7FbNO5/+6s1/EAGPzDtsdpQES3ZlgDK/OJ5s8c1 BYFpnOwfrhZaItFVr9T24PDwuMqd3Db0nTKi9UhtwkvD+eLzTiEKtAXBCsyFOgssAv msUDgXQbpYim1xe1PJNGtprkkkwVKS25jXZ8BdVLSx88HjEloE6A7GltMQ4yoOUsZt Z7kbgEhWU1DGw== Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 35B2427C005C; Mon, 7 Feb 2022 15:41:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 07 Feb 2022 15:41:46 -0500 X-ME-Sender: X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrheehgddufeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufgjfhffkfggtgesthdttddttddttdenucfhrhhomheptfhitghhrghr ugcunfgrfihrvghntggvuceorhhitghhrghrugdrlhgrfihrvghntggvsehunhhiqdhtuh gvsghinhhgvghnrdguvgeqnecuggftrfgrthhtvghrnhepveeivdfgkeeuleduiefhueeg udfggfeggeejteffkeelfedtiefhkeeiveffgfdvnecuffhomhgrihhnpegrlhhrvggrug ihrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheprhiflhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidquddujeekgeehud dvkedqudeltddvjeelgeegqdhrihgthhgrrhgurdhlrgifrhgvnhgtvgeppehunhhiqdht uhgvsghinhhgvghnrdguvgesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 7 Feb 2022 15:41:45 -0500 (EST) Received: from rwl by aquinas with local (Exim 4.92) (envelope-from ) id 1nHApP-00048s-F5; Mon, 07 Feb 2022 21:41:39 +0100 From: Richard Lawrence To: David Rogers , Org-mode list Subject: Re: Turn Emacs holidays into Org appointments? In-Reply-To: References: Date: Mon, 07 Feb 2022 21:41:39 +0100 Message-ID: <87fsoutnng.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=134.2.5.213; envelope-from=richard.lawrence@uni-tuebingen.de; helo=mx03.uni-tuebingen.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644266785; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QIllkc3NVyz50Sn0f+j8RliHHa4ay+h3rzOA2isdlSA=; b=Dqcve6by4r58sz7HzYXCNEYP3NTDT1W319RH/E0uuJDXRuWat8Xq2I/Xg1I4j0CO0ujs+5 Mhud1lviHhsyQcpJ1l9H+ZjOzGPMLWmmKB1UqKCrshyf4f1VT7hnf2MYwu5J/klbxaUbq4 6pYKoa+FUOUP5WVwI8DMYjmFqEugOMaM9cOza3swBh9uTD9mjZo17TcnmDj8Y8CvedUkwG GoUzz6SHBh/dztmINL3LiD1dWt069XwSzcrpy/LCrjJ914fhC0Ojfoha8QzWWh4hEbo+Id l1Jwp6fO/D+ZtC8zaB7EsZ44V0ZNjpWvtzW9hU8mpjEbtWqXp7rrXYNXz5f4SA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644266785; a=rsa-sha256; cv=none; b=bF4O/o5vVXpla8dP1Kx/Srhf5d3SS5pUY5zoNsXlYowFkYvwb0FH80C0Br/vKVgPGxOev0 meRdKmwJ5xHSDHQwE657xOasDTieGsPieWJITc2aKzLVCRLndskKMECH4wehJi59xtsPbF v7nN1OymfElhXgBfeqmemwRt5CnSzPjjUq7i/v9RQkyhFySMUxWsD+VOniI2S1MsHzMRuV HTbUYKouobjCBvNT4yHs0EutdYrjPMpDfv0NX46VoUS7dbhnRzHZWbT32S2Nmd/IIFkQLh gTTLCZgNoDIYOFIvMBjPJ1/fBO4JGHyaZ/JWHTsy3HhRdO9mUx5ERr7Pi6lgTQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=uni-tuebingen.de header.s=20211202test header.b=tZ0JfZKy; dmarc=pass (policy=none) header.from=uni-tuebingen.de; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=uni-tuebingen.de header.s=20211202test header.b=tZ0JfZKy; dmarc=pass (policy=none) header.from=uni-tuebingen.de; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EFC9C2F849 X-Spam-Score: -9.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: MrwpqPEJbOQE Hi David and all, David Rogers writes: > Is there a way that I can use something like the Emacs holiday > forms ... but from inside an Org-mode appointment timestamp Yes, this should be possible. > Here's a mock example of what I'm trying to do: > > * Easter > <(holiday-easter-etc 0)> > ** stuff for Easter > > * The Sunday after Easter > <(holiday-easter-etc 7)> > ** stuff for after Easter Actually, you're pretty close already. Org understands diary sexp entries in timestamps, and diary sexp entries basically allow arbitrary elisp, so you should be able to use the diary functions in combination with the holiday functions to do what you want. See the 'Timestamps' entry in the Org manual, and the 'Special Diary Entries' entry in the Emacs manual, for more. Here is a quick and dirty proof of concept; see if it works for you: * The Sunday after Easter <%%(apply #'diary-date (caar (holiday-easter-etc 7)))> The angle brackets tell Org this is a timestamp. The '%%' says that the following sexp is a diary sexp. And the code inside it feeds the (M D Y) date representation returned by holiday-easter-etc into diary-date. You may need to fiddle with this a bit...holiday-easter-etc is a bit too closely tied to the calendar (it depends on a couple of calendar variables, displayed-year and displayed-month, that cannot be dynamically bound). But you could create your own version that doesn't have this limitation. Hope that helps. -- Best, Richard