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 ms5.migadu.com with LMTPS id MI8SH6sL3WNquQAAbAwnHQ (envelope-from ) for ; Fri, 03 Feb 2023 14:27:07 +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 GBUtHqsL3WNxHgAAG6o9tA (envelope-from ) for ; Fri, 03 Feb 2023 14:27:07 +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 E80932D362 for ; Fri, 3 Feb 2023 14:27:06 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNw4a-0001lN-VN; Fri, 03 Feb 2023 08:25:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNw4Z-0001l1-6r for emacs-orgmode@gnu.org; Fri, 03 Feb 2023 08:25:47 -0500 Received: from mail-sender-5.unibw-hamburg.de ([139.11.10.105] helo=premail.unibw-hamburg.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNw4W-0000mM-Bv for emacs-orgmode@gnu.org; Fri, 03 Feb 2023 08:25:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hsu-hh.de; s=hsu-hh_de; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=to3avZntrr19CWhYT/u9NItjdgV+wfTLxL27GLyXVi4=; t=1675430742; x=1676294742; b=ALncL67eExe2IHFGSk06XicucpcSldg4rPPgKHR4eHVZ0XAbFo2SCXPYSjXZIwHOu2bPsGe81Gb fQ7XMRClecumwgm+ByT0ZIDtqk1/pL8LV7HHJ70N/iRUDs39FC2h6t/RSl+h89zkLo4htW2uADWpB Ce84CGiwlmfQC6bZam4DLep1lA3kKVRy4mhwv5u85nuM35bcuN0wDWhzJ+ZBpAEAIvHHm0JsB836n Bx0c7XfVdUXQkRk5I24a+dKfvQOr8PN1wepXS4N7FQy9bQu6aNMiKW9eHADVWvL1WusWQbi0SNwiB RDOKzzVgM9bkExoQVTMsED70Pkbogd3Emc+A==; Received: from rzav4.unibw-hamburg.de ([139.11.12.54]:15112) by premail.unibw-hamburg.de with esmtp (HSU Mailserver) (envelope-from ) id 1pNw4W-0002rI-0Z for emacs-orgmode@gnu.org; Fri, 03 Feb 2023 14:25:41 +0100 X-IronPort-AV: E=Sophos;i="5.97,270,1669071600"; d="scan'208,223";a="80668609" Received: from mailcluster-1.unibw-hamburg.de (HELO premail.unibw-hamburg.de) ([139.11.5.101]) by rzav4.unibw-hamburg.de with ESMTP; 03 Feb 2023 14:25:42 +0100 Received: from [91.200.109.145] (port=47220 helo=linux.fritz.box) by premail.unibw-hamburg.de with esmtpsa (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (HSU Mailserver) (envelope-from ) id 1pNw4V-0002eu-MG; Fri, 03 Feb 2023 14:25:41 +0100 Date: Fri, 3 Feb 2023 14:25:08 +0100 From: Detlef Steuer To: emacs-orgmode@gnu.org Subject: Re: [patch] improved: add TTL as defcustom to ox-icalendar Message-ID: <20230203142508.4140679f@linux.fritz.box> In-Reply-To: <87a62hihcg.fsf@localhost> References: <20211230225919.1a660666@hsu-hh.de> <20220102142849.0af72bcb@hsu-hh.de> <20220103084141.72d2f384@hsu-hh.de> <20220103123253.6bb48655@hsu-hh.de> <87o7tgaa42.fsf@localhost> <20221109082520.066dc4c6@linux.fritz.box> <20230113181035.1469ab37@hsu-hh.de> <878ri52z06.fsf@localhost> <20230116234230.5080fb07@linux.fritz.box> <87lem1ijih.fsf@localhost> <20230117110316.56a1899e@gaia.unibw-hamburg.de> <87a62hihcg.fsf@localhost> Organization: HSU X-Mailer: Claws Mail 4.1.1 (GTK 3.24.35; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/MQL.ePwOeHnoFWheawTTtw5" X-HSU-Virusscan: Routed to first Viruswall X-Brisant: Sender steuer@hsu-hh.de X-HSU-Virusscan: First Viruswall passed X-Authenticated-Sender: 13438/91.200.109.145 X-HSU-Virusscan: Routed to second Viruswall (Cisco Ironport ESAV) X-Brisant: Sender steuer@hsu-hh.de Received-SPF: pass client-ip=139.11.10.105; envelope-from=prvs=0398dbe93d=steuer@hsu-hh.de; helo=premail.unibw-hamburg.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675430827; 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=to3avZntrr19CWhYT/u9NItjdgV+wfTLxL27GLyXVi4=; b=RxjyZg5PEZHje5UOP+OcmKnJ5+fhtRTA/qS4KMcSmYtZUeDp3YddecCIYskt/8G6ZdLuUo TMsgJPGn7xdFoFlpIrFX/84UbLqcT+ks3I6u+LjxoUkTq9V/fGAv340Iz2pD32PdC7dYfS 0slEN8d7sE1K5OEtMs0vA+OD375hJJ1CLmcFlPWZ3VNcIRd7/fR+4o3E7oiPXiS4o1N89N gwwFo/TkUIMnE0h01E9yQHbDC8UxiL0CW5fGSsmgccBnOrh1iSm/gHv5iXsd+XMdbVnTl6 rySiRdvk57pst6RJrdnIDc1FErIc4j/ax0QW75Mdebns8vX9cCR/W85q1SM/rA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=hsu-hh.de header.s=hsu-hh_de header.b=ALncL67e; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675430827; a=rsa-sha256; cv=none; b=FJftcZ8mdE9OG+d9V/aDn+JJbzsrVMQ5Gptm2yJ8VArtKyPDJBI90DY6s7LuSJ5Tv/UcWe rS8DVkCVPR+CFK42PWVln8lf0paNZ9eKquEb/aIm7d65WZsIX0gPbDHr+2YqiaVoUr77VL PnpVC5XXXni6D4pQCSMGgzTZLln6GQAJ7DA6e5czISQ4nI8wTagDUuJDNkjljRLVEVvhsJ hAh7wSqzUOnW+V21/vt4sFWY/tqcwfFlvagFakQtVXuAja3nMU5OZ4NGVNBoOwFIIKp0cu hSYcKC5lAEof+Eyh1Q7yCBpx0Cm6S+7aCdn7dI3SUJhhKhhV92o4YpvsT2kUSA== X-Migadu-Queue-Id: E80932D362 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=hsu-hh.de header.s=hsu-hh_de header.b=ALncL67e; dmarc=none; 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: -0.07 X-Spam-Score: -0.07 X-TUID: lDtykQ16v6ZA --MP_/MQL.ePwOeHnoFWheawTTtw5 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Am Tue, 17 Jan 2023 10:30:07 +0000 schrieb Ihor Radchenko : > Detlef Steuer writes: > > >> The patch only allows to the TTL globally for all the calendars. > >> However, it would make sense to specify TTL on per-file basis. > >> WDYT? > > > > Hmm. Surely it would be useful to have the option to use different > > TTL settings for different calendar exports, yes. > > > > The next question would be, if org-icalendar-combine-agenda-files is > > called and the files have different per-file settings, which will be > > used? > > The only sane way would be using the global default. > > > May be single file org-icalendar-export-to-ics and > > org-icalender-export-agenda-files use an existing per-file setting, > > global setting otherwise, but org-icalendar-combine-agenda-files > > always uses the global setting? > > Agree. > > To achieve this you just need to update the export option settings: > > (:icalendar-ttl nil nil org-icalendar-ttl) > > adding a file keyword to be used. > See `org-export-options-alist' docstring. > Hi Ihor, I hope I understood your advice and the docstring and examples in other exporters correctly. Is it really that easy? Next iteration of the patch. Detlef --MP_/MQL.ePwOeHnoFWheawTTtw5 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-Add-TTL-to-icalendar-export-options.patch >From 0af9cf3d1e742271531f047f2ed0a690a81261c7 Mon Sep 17 00:00:00 2001 From: Detlef Steuer Date: Fri, 3 Feb 2023 14:11:00 +0100 Subject: [PATCH 1/2] Add TTL to icalendar export options --- lisp/ox-icalendar.el | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el index 81a77a770..600eaae24 100644 --- a/lisp/ox-icalendar.el +++ b/lisp/ox-icalendar.el @@ -297,6 +297,21 @@ Interesting value are: (const :tag "Universal time" ":%Y%m%dT%H%M%SZ") (string :tag "Explicit format"))) +(defcustom org-icalendar-ttl "PT1H" + "The time to life for the exported calendar. +Subscribing clients to the exported ics file can derive the time interval +to read the file again from the server. One example of such a client is +the nextcloud calendar, which respects the setting of +X-PUBLISHED-TTL, i.e. X-PUBLISHED-TTL:PT1H . + +See https://icalendar.org/iCalendar-RFC-5545/3-8-2-5-duration.html +for a complete description of possiblee values of this option. I.e. +PT1H stands for 1 hour, PT0H27M34S for 0 hours, 27 minutes and 34 seconds. + +This option can also be set with the ICAL-TTL keyword." + :group 'org-export-icalendar + :type 'string) + (defvar org-icalendar-after-save-hook nil "Hook run after an iCalendar file has been saved. This hook is run with the name of the file as argument. A good @@ -333,6 +348,7 @@ re-read the iCalendar file.") (:icalendar-timezone nil nil org-icalendar-timezone) (:icalendar-use-deadline nil nil org-icalendar-use-deadline) (:icalendar-use-scheduled nil nil org-icalendar-use-scheduled) + (:icalendar-ttl "ICAL-TTL" nil org-icalendar-ttl) (:icalendar-scheduled-summary-prefix nil nil org-icalendar-scheduled-summary-prefix) (:icalendar-deadline-summary-prefix nil nil org-icalendar-deadline-summary-prefix)) :filters-alist @@ -872,13 +888,16 @@ as a communication channel." (or (org-string-nw-p org-icalendar-timezone) (format-time-string "%Z")) ;; Description. (org-export-data (plist-get info :title) info) + ;; TTL + org-icalendar-ttl contents)) -(defun org-icalendar--vcalendar (name owner tz description contents) +(defun org-icalendar--vcalendar (name owner tz description ttl contents) "Create a VCALENDAR component. -NAME, OWNER, TZ, DESCRIPTION and CONTENTS are all strings giving, +NAME, OWNER, TZ, DESCRIPTION, TTL and CONTENTS are all strings giving, respectively, the name of the calendar, its owner, the timezone -used, a short description and the other components included." +used, a short description, the time-to-live resp. refresh period and +the other components included." (concat (format "BEGIN:VCALENDAR VERSION:2.0 X-WR-CALNAME:%s @@ -1018,6 +1037,7 @@ This function assumes major mode for current buffer is user-full-name (or (org-string-nw-p org-icalendar-timezone) (format-time-string "%Z")) org-icalendar-combined-description + org-icalendar-ttl contents))) (run-hook-with-args 'org-icalendar-after-save-hook file))) @@ -1042,6 +1062,8 @@ FILES is a list of files to build the calendar from." (format-time-string "%Z")) ;; Description. org-icalendar-combined-description + ;; TTL (Refresh period) + org-icalendar-ttl ;; Contents. (concat ;; Agenda contents. -- 2.39.1 --MP_/MQL.ePwOeHnoFWheawTTtw5 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-Add-entry-for-new-org-icalendar-ttl-option-to-ORG-NE.patch >From 2a1376457a7d09b6586bea55061aa0aa99509106 Mon Sep 17 00:00:00 2001 From: Detlef Steuer Date: Fri, 3 Feb 2023 14:20:52 +0100 Subject: [PATCH 2/2] Add entry for new org-icalendar-ttl option to ORG-NEWS --- etc/ORG-NEWS | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 40477e73f..c10f95d67 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -24,6 +24,23 @@ consider [[https://gitlab.com/jackkamm/ob-python-mode-mode][ob-python-mode-mode] has been ported to. ** New and changed options +*** New custom setting ~org-icalendar-ttl~ for the ~ox-icalendar~ backend + +The option ~org-icalendar-ttl~ allows to advise a subscriber to the +exported ~.ics~ file to reload after the given time interval. + +This is useful i.e. if a calendar server subscribes to your exported +file and that file is updated regularly. + +See IETF RFC 5545, Section 3.3.6 Duration, and +https://en.wikipedia.org/wiki/ICalendar#Other_component_types for +details. + +Default for ~org-icalendar-ttl~ is nil. In that case the setting will +not be used in the exported ICS file. + +The option may also be set using the ICAL-TTL keyword. + *** ~org-clock-x11idle-program-name~ now defaults to =xprintidle=, when available When =xprintidle= executable is available at =org-clock= load time, it -- 2.39.1 --MP_/MQL.ePwOeHnoFWheawTTtw5--