emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Detlef Steuer <steuer@hsu-hh.de>
To: emacs-orgmode@gnu.org
Subject: Re: [patch] improved: add TTL as defcustom to ox-icalendar
Date: Sun, 2 Jan 2022 14:28:49 +0100	[thread overview]
Message-ID: <20220102142849.0af72bcb@hsu-hh.de> (raw)
In-Reply-To: <20211230225919.1a660666@hsu-hh.de>

[-- Attachment #1: Type: text/plain, Size: 911 bytes --]

Improved patch since org-icalendar-template needed to use
the new variable, too.

And now based on 9.5.2 from elpa.

Detlef


Am Thu, 30 Dec 2021 22:59:19 +0100
schrieb Detlef Steuer <steuer@hsu-hh.de>:

> This is my first try ever to contribute anything in elisp.
> 
> The nextcloud calendar app supports the X-PUBLISHED-TTL 
> option if subscribing to an ics file. Nextcloud defaults
> to a TTL of 1 week, what is much too long for my use case.
> 
> When exporting to such a file from org I did not find any way
> to set this option during export. So I tried to add a defcustom
> in ox-icalendar.el.
> 
> The default TTL in this patch is 1 hour.
> 
> I think this qualifies as an tiny patch, as it is mostly a docstring
> :-), in case anybody finds this an useful addition.
> 
> The patch is relative to 9.5.1 from elpa.
> 
> All comments very much appreciated.
> 
> And a happy new year to you all
> Detlef


[-- Attachment #2: addttl.patch --]
[-- Type: text/x-patch, Size: 1666 bytes --]

267a268,280
> (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."
>   :group 'org-export-icalendar
>   :type 'string)
> 
303c316,317
<     (:icalendar-use-scheduled nil nil org-icalendar-use-scheduled))
---
>     (:icalendar-use-scheduled nil nil org-icalendar-use-scheduled)
>     (:icalendar-ttl nil nil org-icalendar-ttl))
830a845,846
>    ;; TTL
>    org-icalendar-ttl
833c849
< (defun org-icalendar--vcalendar (name owner tz description contents)
---
> (defun org-icalendar--vcalendar (name owner tz description ttl contents)
835c851
< NAME, OWNER, TZ, DESCRIPTION and CONTENTS are all strings giving,
---
> NAME, OWNER, TZ, DESCRIPTION, TTL and CONTENTS are all strings giving,
837c853,854
< 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."
843a861
> X-PUBLISHED-TTL:%s
848c866,867
< 		  (org-icalendar-cleanup-string description))
---
> 		  (org-icalendar-cleanup-string description)
> 		  (org-icalendar-cleanup-string ttl))
976a996
> 	org-icalendar-ttl
1000a1021,1022
> 	      ;; TTL (Refresh period)
> 	      org-icalendar-ttl

  reply	other threads:[~2022-01-02 13:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 21:59 [patch] add TTL as defcustom to ox-icalendar Detlef Steuer
2022-01-02 13:28 ` Detlef Steuer [this message]
2022-01-03  6:08   ` [patch] improved: " Max Nikulin
2022-01-03  7:41     ` Detlef Steuer
2022-01-03 11:23       ` Max Nikulin
2022-01-03 11:32         ` Detlef Steuer
2022-11-09  6:57           ` Ihor Radchenko
     [not found]             ` <20221109082520.066dc4c6@linux.fritz.box>
2022-11-09  7:58               ` Ihor Radchenko
2022-11-09  8:32                 ` Bastien Guerry
     [not found]               ` <20230113181035.1469ab37@hsu-hh.de>
     [not found]                 ` <878ri52z06.fsf@localhost>
2023-01-16 22:42                   ` Detlef Steuer
2023-01-17  9:43                     ` Ihor Radchenko
2023-01-17 10:03                       ` Detlef Steuer
2023-01-17 10:30                         ` Ihor Radchenko
2023-02-03 13:25                           ` Detlef Steuer
2023-02-04 11:09                             ` Ihor Radchenko
2023-02-04 21:01                               ` Detlef Steuer
2023-02-05 11:09                                 ` Ihor Radchenko
2024-01-27  5:00                                   ` Jack Kamm
2024-01-28 13:42                                     ` Ihor Radchenko
2024-01-28 21:50                                       ` Jack Kamm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220102142849.0af72bcb@hsu-hh.de \
    --to=steuer@hsu-hh.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).