From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MFnBLQWFIWSIawEASxT56A (envelope-from ) for ; Mon, 27 Mar 2023 13:59:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eDwyLQWFIWRgcAEAauVa8A (envelope-from ) for ; Mon, 27 Mar 2023 13:59:01 +0200 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 5D6002BB7C for ; Mon, 27 Mar 2023 13:59:01 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="G/iMeSCa"; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679918341; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=R8ve9tmqs6esRQnLhzwzDZBhPEw+NFyIgilf1F/iBss=; b=oZ2bX931RonJVRMevReihAgAp2/7rZNGzVCbmzjFd8kXurxKJdqHbBd83zu/IKK3GyuV5i xpdLai6T5+QtsZVi1Uhg2Y0h587NpWMfelenyvM+rEUpuXZSvven4b2EnJgHLmSHKrKANy qzJYY8JZOpAmar0ayZ88mD3M3FRxgRM2HgKQ91A2SAdrVTkznhep8RaRnA6S9yzpHad7ih 1+SpLGF4UxzA8OAkK+dGOF+cv5maFXftisMuhHux+4s099jbYsIVWomD/WMlJXM6+UAw3Y ry3obWxBqLxC4fspMoIHo6VJTucuJuPnqSzflkhRa2aVsKrj3ZJkrvZbxU1Ddg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679918341; a=rsa-sha256; cv=none; b=VzBQQIsZkEzWsaauiqJMlNgHbGd1bmBDV1BBbA+PFsS0qE4GI7OOCKYl4q8pNxzn7m8Irn kIlKscVnVsMY84+cat20rP8xqp70CA96FATk37FAFt39zEDaYRykk8lHaLwtH0Vj/bjboV QHQu683o8bxE6MUwH/zLbe+aJbNkIbP36njgT41QJHlXfapvNMbEIKR7MbTjQobbtGufRs 2nmkFzBvy5xqdS2RPeO316zYauEEGpKHO464Y7S4I50udkg5GZVtxyQHFvNB4EWwqep32X 3dbsPi85N2d4Dqnczb7XOXyxqZsaCcQmGG66e7caNC4mxYAZuZxZf4JHhwRDXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="G/iMeSCa"; 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"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pglUF-0000Ti-Lg; Mon, 27 Mar 2023 07:58:07 -0400 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 1pglUD-0000TN-IF for emacs-orgmode@gnu.org; Mon, 27 Mar 2023 07:58:05 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pglUB-0002Tr-5O for emacs-orgmode@gnu.org; Mon, 27 Mar 2023 07:58:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8189C240177 for ; Mon, 27 Mar 2023 13:58:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1679918281; bh=IyRPj7DP+2Cuse1DI51bcHEYs5e1sViW669RyIj4CZ4=; h=From:To:Cc:Subject:Date:From; b=G/iMeSCaRZ9Q0DkLK5/9/8GWVHNjCrVYkU4L3WaZcI8UjE1aynOp87YgxljWykl9T 3FAdQJCgZ1ZTb4iSVx85msMdwtU9jMQ8WINIXvgsiO2teDywur4ahl3eIbTHOnALDv nc+zt7ZQe3BvmfEeBOsfe/kzBYN1C9JPZsxAyZ7IimHJDv3PYJbwUnsePLxvwFq3CN P4OSL+L2JC4WNFxwu5PZNsJrtqWxdapsWZACBHZbrkvkhWm+Xfs92OPR8uCKWZOQwp 91eU1E9pZO3ct0TUJw7jdNWLAoY7UeQEgZvyDgiQxNQk9XB875Kb6rteq6QUQHLKj5 Mw5bTOWCNwqIw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PlWXm6FYYz6tmg; Mon, 27 Mar 2023 13:58:00 +0200 (CEST) From: Ihor Radchenko To: Jack Kamm Cc: emacs-orgmode@gnu.org, mail@nicolasgoaziou.fr Subject: Re: [RFC] ox-icalendar: Unscheduled tasks & repeating tasks In-Reply-To: <874jq75okg.fsf@gmail.com> References: <874jq75okg.fsf@gmail.com> Date: Mon, 27 Mar 2023 11:59:59 +0000 Message-ID: <87o7oetneo.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.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, RCVD_IN_MSPIKE_H2=-0.001, 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: X-Migadu-Queue-Id: 5D6002BB7C X-Spam-Score: -11.55 X-Migadu-Spam-Score: -11.55 X-Migadu-Scanner: scn0.migadu.com 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 X-TUID: IydJnmwLN4SJ Jack Kamm writes: > For patch 1 (unscheduled tasks): > > Currently, ox-icalendar does not allow creating an iCalendar task > without a scheduled start date. If an Org TODO is missing a SCHEDULED > timestamp, then ox-icalendar sets today as the scheduled start date for > the exported task. > > Patch 1 changes this by adding a new customization > org-icalendar-todo-force-scheduling. When non-nil, the start date is set > to today (same as the current behavior). When nil, unscheduled Org TODOs > are instead exported without a start date. > > I also propose the default value to be nil. Note, this is > backwards-incompatible with the previous behavior! > > But I think it should be the default anyways, because IMO it is the more > correct and useful behavior. An iCalendar VTODO without a DTSTART > property is valid, and has the same meaning as an Org TODO without a > SCHEDULED timestamp. Also, all the iCalendar programs I have tried > support unscheduled tasks, including Thunderbird, Evolution, Nextcloud, > and Tasks.org. I agree that omitting DTSTART will make more sense. > For patch 2 (repeating timestamps): > > I add recurrence rule (RRULE) export for repeating SCHEDULED and > DEADLINE timestamps in TODOs, similar to how repeating non-TODO events > are currently handled. > > The main complication here is that iCalendar's RRULE applies to both > DTSTART and DUE properties; by contrast, Org's SCHEDULED and DEADLINE > timestamps may have different repeaters. I am not sure the best way to > handle the case where SCHEDULED and DEADLINE have different repeaters, > so in that case I issue a warning and skip the repeater. In the case of different repeaters, we can use RDATE (https://icalendar.org/iCalendar-RFC-5545/3-8-5-2-recurrence-date-times.html) and generate occurrences manually sufficiently far into future. ("how far" should be a defcustom). However, different repeaters for deadline and schedule are most likely a mistake - we can report it via org-lint and in ox-icalendar, as warning. Another scenario we may need to consider is when schedule has a repeater while deadline does not, and vice versa. The former scenario is probably valid - a VTODO with limited number of occurrences. The latter is likely a mistake we should raise warning about. It is also not clear how to represent moving event deadline in iCalendar. See more inline comments below. > +(defcustom org-icalendar-todo-force-scheduling nil > + "Non-nil means unscheduled tasks are exported as scheduled. > +The current date is used as the scheduled time for such tasks." > + :group 'org-export-icalendar > + :type 'boolean) Please add :package-version and possibly :safe keywords. We may also refer to `org-icalendar-include-todo' in the docstring. > - (org-icalendar-convert-timestamp start "DTSTART" nil timezone) "\n" > + (when start > + (concat (org-icalendar-convert-timestamp > + start "DTSTART" nil timezone) > + "\n")) Side note: here, and in other places, we use "\n" as end of line. Yet, for example https://icalendar.org/iCalendar-RFC-5545/3-8-2-4-date-time-start.html prescribes CRLF (\r\n). Also, see https://orgmode.org/list/87ilgljv6i.fsf@localhost If you are familiar with iCalendar spec, may you look through the ox-icalendar code and check other places where we do not conform to the newline spec? Ideally, we want a set of private functions ensuring proper prescribed format for all the used iCalendar syntax entries. Otherwise, we will keep forgetting about these subtleties. > +(defun org-icalendar--rrule (unit value) > + (format "RRULE:FREQ=%s;INTERVAL=%d\n" \r\n -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at