GNU bug report logs - #54939
29.0.50; icalendar cannot infer the DTEND from DTSTART + DURATION

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: John Hamelink <me@HIDDEN>; dated Thu, 14 Apr 2022 14:30:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 54939 <at> debbugs.gnu.org:


Received: (at 54939) by debbugs.gnu.org; 17 Apr 2022 18:00:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 17 14:00:47 2022
Received: from localhost ([127.0.0.1]:37107 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ng9CZ-0007XV-4s
	for submit <at> debbugs.gnu.org; Sun, 17 Apr 2022 14:00:47 -0400
Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59496)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1ng9CX-0007XF-C2
 for 54939 <at> debbugs.gnu.org; Sun, 17 Apr 2022 14:00:45 -0400
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id BEC04160090;
 Sun, 17 Apr 2022 11:00:39 -0700 (PDT)
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id GjCmcs4XrI81; Sun, 17 Apr 2022 11:00:39 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1])
 by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25BB11600CE;
 Sun, 17 Apr 2022 11:00:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu
Received: from zimbra.cs.ucla.edu ([127.0.0.1])
 by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id jVgAl7VSYxuu; Sun, 17 Apr 2022 11:00:39 -0700 (PDT)
Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com
 [172.91.119.151])
 by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id F3E14160090;
 Sun, 17 Apr 2022 11:00:38 -0700 (PDT)
Message-ID: <30ac1138-ceac-4224-3501-f0996b7ac0cd@HIDDEN>
Date: Sun, 17 Apr 2022 11:00:38 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
 Thunderbird/91.7.0
Content-Language: en-US
To: John Hamelink <me@HIDDEN>
From: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#54939: 29.0.50; icalendar cannot infer the DTEND from DTSTART
 + DURATION
Organization: UCLA Computer Science Department
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54939
Cc: 54939 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> In `icalendar--decode-isodatetime', hours,
> minutes and seconds are set to 0 by default, effectively normalising
> date to datetime. I wonder if there's a function already implemented
> for this that I don't know about yet?

I don't know the answer to your question. That being said, the 
"icalendar--" prefix means this is a private function, so you can change 
it to do what you want, so long as its callers in icalendar.el are 
adjusted accordingly.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54939; Package emacs. Full text available.

Message received at 54939 <at> debbugs.gnu.org:


Received: (at 54939) by debbugs.gnu.org; 15 Apr 2022 10:06:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 15 06:06:26 2022
Received: from localhost ([127.0.0.1]:58153 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nfIqO-0004DQ-RG
	for submit <at> debbugs.gnu.org; Fri, 15 Apr 2022 06:06:25 -0400
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:35637)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1nfIqL-0004DB-PR
 for 54939 <at> debbugs.gnu.org; Fri, 15 Apr 2022 06:06:23 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 53B025C020D
 for <54939 <at> debbugs.gnu.org>; Fri, 15 Apr 2022 06:06:16 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Fri, 15 Apr 2022 06:06:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnhame.link;
 h=cc:content-type:date:date:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:sender:subject
 :subject:to:to; s=fm3; t=1650017176; x=1650103576; bh=1Cf8v7qb7C
 nOvIoMRVun/ZxBn6u0flCL0CdkYWet9bU=; b=i4oIYZfWWuM9v3mg8KK1WwENM1
 CWDGQezgbjcfuTdh6gV+u7EPdI1PHrfxodOMQVBKDJJcG5IibnknFyiSvOtPm4Tm
 9mTuPCa8yR5FatigV9dGLrK5joH21Mz0AIXGtJvbLvIbHbdW86VHNf7L3FG2W6jS
 NsIgBQyOBbHHuqW1VGvQyCI86i2Lgy2glgNFvLZRvuFxdauHvEwaEqaXYGcLu8xf
 WWBJvDigmcXDD/snRw7wSuy/2OvWffugTd85s1JGMPUZowm71+wd1rAM5DfWapo3
 Y6fROn1nJ+H9fLzAVKmLYmt4mMx6sUQukWL3wU2SJxc+WimgyiJGPWwL7Big==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650017176; x=
 1650103576; bh=1Cf8v7qb7CnOvIoMRVun/ZxBn6u0flCL0CdkYWet9bU=; b=U
 jLO7BLA4HD+gEjP8M9wRDYEYdG+SV4bxnisqWEXHok1ov22EvFGn+l+zq4QaVtds
 +52XzduDPxgNVH+LxqKINRzZ+6H9Kb8hqpfWC+cHf2fy8SQDbOk6+Z3+RIj4J6IN
 JPef9slHB/USL5C8KIGjx50s2+1SQjxGbr5Hb0p3EN4PlYq/S20GwJLsxR9czIWi
 h10K3Tdx8Lt5makKNUuTZwzQAPzEPsJFrhKABm6PPY0c6qx3K7KFLUvrsYU0DKVJ
 XLVMTPGSWc0VHR+3OH5fKxA/ZkJBORqKGa8cZtFtto0qS/GWTW/dPHZQHILrzCh/
 lGntxm3dj2GksWl9W/lcQ==
X-ME-Sender: <xms:mENZYgBypDEYud1mLVAtU9rkSCu3I7qZgu1WBNf-CzQz23rq0BttKA>
 <xme:mENZYiimZkGl8NK7jY0S_X3_3dEz-t4OfqCJOT_HPAno3UrMJsuGf50k7wiHOQqQh
 vosdFmjeC2rBpiXzw>
X-ME-Received: <xmr:mENZYjkHPeZMAWxKxTlRclhBOexD_GA5g4oUQ9NCfCCdQ6PKQv-mhpCg-Ko>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelhedgvdefucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuffhffggjkfggtgesghdtre
 ertdertdenucfhrhhomheplfhohhhnucfjrghmvghlihhnkhcuoehmvgesjhhohhhnhhgr
 mhgvrdhlihhnkheqnecuggftrfgrthhtvghrnhepudekgfetvdegffeileeigfeghfettd
 egffelteduheevieffleeigeevuddvheeknecuvehluhhsthgvrhfuihiivgeptdenucfr
 rghrrghmpehmrghilhhfrhhomhepmhgvsehjohhhnhhhrghmvgdrlhhinhhk
X-ME-Proxy: <xmx:mENZYmy16Dfugn27rCcW2-NQHtAp1gHpJrJB0dM5uIK_5EdQLznHXw>
 <xmx:mENZYlQL6ASR_H8qDjveQNLpE6fyp_kVXnV1eFr5hXeRzcbA4NGKqQ>
 <xmx:mENZYhbnUFt6xgX0YPPi1D3KANIzXzs1qfb0RS93RlaB8fxaMoHfgA>
 <xmx:mENZYgN2-npIkFcJmbYVNgNl6gqG2IuY_t1QOVJx4WCjCcC9UBdPAQ>
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <54939 <at> debbugs.gnu.org>; Fri, 15 Apr 2022 06:06:15 -0400 (EDT)
From: John Hamelink <me@HIDDEN>
To: 54939 <at> debbugs.gnu.org
Subject: Re: bug#54939: 29.0.50; icalendar cannot infer the DTEND from
 DTSTART + DURATION
Date: Fri, 15 Apr 2022 10:39:20 +0100
References: <87fsmfoi0f.fsf@HIDDEN> <87v8vbk97u.fsf@HIDDEN>
 <87fsmf32d0.fsf@HIDDEN>
User-agent: mu4e 1.6.10; emacs 29.0.50
In-reply-to: <87fsmf32d0.fsf@HIDDEN>
Message-ID: <87k0bqk6eh.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="===-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 54939
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--===-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: multipart/mixed; boundary="==-=-="

--==-=-=
Content-Type: text/plain
Content-Disposition: inline

John Hamelink <me@HIDDEN> writes:
> Great, then I'll have a crack at writing such a patch. I'm new to
> Emacs lisp, but this seems to me like a manageable first task!

OK, so I've implemented something that's approaching spec - but not
ready for full review yet: particularly because I have a problem I
need some guidance on. I have introduced the following tests:

`gnus-icalendar-dtstart-only-date' (Failing)
- `DTSTART' is `DTSTART;TZID=Europe/Berlin:20200915'
- `DTEND' is undefined
- `DURATION' is undefined
- Fails because the `gnus-icalendar--datetimep' returns a truthy
  value.

`gnus-icalendar-dtstart-only-datetime' (Passing)
- `DTSTART' is `DTSTART;TZID=Europe/Berlin:20200915T140000'
- `DTEND' is undefined
- `DURATION' is undefined

`gnus-icalendar-dtstart-duration' (Passing)
- `DTSTART' is `DTSTART;TZID=Europe/Berlin:20200915T140000'
- `DTEND' is undefined
- `DURATION' is `PT3H'

The reason `gnus-icalendar-dtstart-only-date' currently fails is
because I haven't found a good way to differentiate between a date and
a datetime - as the spec requires.

In an attempt to unblock the rest of the implementation, I used the
following:

(defun gnus-icalendar--datep (date)
"return t if DATE matches a date list."
(and (length= date 9)
    (length=
        (seq-filter 'integerp (seq-take date 6))
        3)))

(defun gnus-icalendar--datetimep (datetime)
"Return t if DATETIME matches a date-time list."
(and (length= datetime 9)
(length=
    (seq-filter 'integerp (seq-take datetime 6))
    6)))

This strategy doesn't work. In `icalendar--decode-isodatetime', hours,
minutes and seconds are set to 0 by default, effectively normalising
date to datetime. I wonder if there's a function already implemented
for this that I don't know about yet?

I've included all my patches so far, but I do plan on refactoring more
and then checking my contribution against the contributing guidelines
before formally submitting a patch for review.

I've also sent an email to assign@HIDDEN pre-emptively, in case that
is necessary.

Thanks!
JH

--==-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0005-lisp-gnus-gnus-icalendar-Add-RFC5545-DTEND-calculati.patch
Content-Transfer-Encoding: quoted-printable

From=20c8e460cc0657cb9ddf9e0fbc9abbca32c9344414 Mon Sep 17 00:00:00 2001
From: John Hamelink <me@HIDDEN>
Date: Fri, 15 Apr 2022 03:35:18 +0100
Subject: [PATCH 5/5] lisp/gnus/gnus-icalendar: Add RFC5545 DTEND calculation
 function

`gnus-icalendar-event--calculate-end-time' returns:
 - DTEND if it is set
 - or DTSTART + DURATION if DURATION is set
 - or DTSTART + 1 Day if DTSTART is a DATE
 - or DTSTART if DTSTART is a DATETIME
=2D--
 lisp/gnus/gnus-icalendar.el            |  27 ++-
 test/lisp/gnus/gnus-icalendar-tests.el | 238 +++++++++++++++++++++++++
 2 files changed, 263 insertions(+), 2 deletions(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 036832e1d5..64b21794cb 100644
=2D-- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -237,6 +237,29 @@ gnus-icalendar--datetimep
     (seq-filter 'integerp (seq-take datetime 6))
     6)))
=20
+(defun gnus-icalendar-event--calculate-end-time (event zone-map)
+  "Return DTEND, or calculate it as per RFC5545 3.6.1."
+  (let* ((dtstart (decode-time (gnus-icalendar-event--decode-datefield
+                                event 'DTSTART zone-map)))
+         (dtend (gnus-icalendar-event--decode-datefield
+                 event 'DTEND zone-map))
+         (duration (gnus-icalendar-event--decode-duration
+                    event 'DURATION)))
+    (cond
+     ;; Either Return DTEND
+     ((not (null dtend)) dtend)
+     ;; or DTSTART + DURATION if DURATION exists
+     ((not (null duration))
+      (encode-time
+       (icalendar--add-decoded-times dtstart duration)))
+     ;; or DTSTART + 1DAY if DTSTART is a DATE
+     ((gnus-icalendar--datep dtstart)
+      (encode-time (icalendar--add-decoded-times
+                    dtstart (icalendar--decode-isoduration "1D"))))
+     ;; or DSTART if DTSTART is a DATE-TIME
+     ((gnus-icalendar--datetimep dtstart)
+      (encode-time dtstart)))))
+
 (defun gnus-icalendar-event-from-ical (ical &optional attendee-name-or-ema=
il)
   (let* ((event (car (icalendar--all-events ical)))
          (organizer (replace-regexp-in-string
@@ -266,8 +289,8 @@ gnus-icalendar-event-from-ical
                 :organizer organizer
                 :start-time (gnus-icalendar-event--decode-datefield
                              event 'DTSTART zone-map)
=2D                :end-time (gnus-icalendar-event--decode-datefield
=2D                           event 'DTEND zone-map)
+                :end-time (gnus-icalendar-event--calculate-end-time
+                           event zone-map)
                 :rsvp (string=3D (plist-get (cadr attendee) 'RSVP) "TRUE")
                 :participation-type participation-type
                 :req-participants (car attendee-names)
diff --git a/test/lisp/gnus/gnus-icalendar-tests.el b/test/lisp/gnus/gnus-i=
calendar-tests.el
index 5fecfd3773..c26ddaf44c 100644
=2D-- a/test/lisp/gnus/gnus-icalendar-tests.el
+++ b/test/lisp/gnus/gnus-icalendar-tests.el
@@ -281,5 +281,243 @@ gnus-icalendary-weekly-byday
 <2020-09-21 14:00-14:30 +1w>")))
       (setenv "TZ" tz))))
=20
+(ert-deftest gnus-icalendar-dtstart-duration ()
+  ""
+
+  (let ((tz (getenv "TZ"))
+        (event (gnus-icalendar-tests--get-ical-event "\
+BEGIN:VCALENDAR
+PRODID:-//Google Inc//Google Calendar 70.9054//EN
+VERSION:2.0
+CALSCALE:GREGORIAN
+METHOD:REQUEST
+BEGIN:VTIMEZONE
+TZID:Europe/Berlin
+X-LIC-LOCATION:Europe/Berlin
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=3DYEARLY;BYMONTH=3D3;BYDAY=3D-1SU
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=3DYEARLY;BYMONTH=3D10;BYDAY=3D-1SU
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTART;TZID=3DEurope/Berlin:20200915T140000
+DURATION:PT3H
+RRULE:FREQ=3DWEEKLY;BYDAY=3DFR,MO,TH,TU,WE
+DTSTAMP:20200915T120627Z
+ORGANIZER;CN=3Danon@HIDDEN:mailto:anon@HIDDEN
+UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@HIDDEN
+ATTENDEE;CUTYPE=3DINDIVIDUAL;PARTSTAT=3DACCEPTED;RSVP=3DTRUE
+ ;CN=3Dparticipant@HIDDEN;X-NUM-GUESTS=3D0:mailto:participant@ano=
ncompany.com
+CREATED:20200325T095723Z
+DESCRIPTION:Coffee talk
+LAST-MODIFIED:20200915T120623Z
+LOCATION:
+SEQUENCE:0
+STATUS:CONFIRMED
+SUMMARY:Casual coffee talk
+TRANSP:OPAQUE
+END:VEVENT
+END:VCALENDAR" (list "participant@HIDDEN"))))
+
+    (unwind-protect
+        (progn
+          ;; Use this form so as not to rely on system tz database.
+          ;; Eg hydra.nixos.org.
+          (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
+          (should (eq (eieio-object-class event) 'gnus-icalendar-event-req=
uest))
+          (should (gnus-icalendar-event:recurring-p event))
+          (should (string=3D (gnus-icalendar-event:recurring-interval even=
t) "1"))
+          (should (string=3D (gnus-icalendar-event:start event) "2020-09-1=
5 14:00"))
+          (should (string=3D (gnus-icalendar-event:end event) "2020-09-15 =
17:00"))
+          (with-slots (organizer summary description location end-time uid=
 rsvp participation-type) event
+            (should (string=3D organizer "anon@HIDDEN"))
+            (should (string=3D summary "Casual coffee talk"))
+            (should (string=3D description "Coffee talk"))
+            (should (string=3D location ""))
+            (should (string=3D (format-time-string "%Y-%m-%d %H:%M" end-ti=
me) "2020-09-15 17:00"))
+            (should (string=3D uid "7b6g3m7iftuo90ei4ul00feqn_R20200915T12=
0000@HIDDEN"))
+            (should rsvp)
+            (should (eq participation-type 'required)))
+          (should (equal (sort (gnus-icalendar-event:recurring-days event)=
 #'<) '(1 2 3 4 5)))
+          (should (string=3D (gnus-icalendar-event:org-timestamp event) "<=
2020-09-15 14:00-17:00 +1w>
+<2020-09-16 14:00-17:00 +1w>
+<2020-09-17 14:00-17:00 +1w>
+<2020-09-18 14:00-17:00 +1w>
+<2020-09-21 14:00-17:00 +1w>"))
+
+          )
+      (setenv "TZ" tz))))
+
+
+(ert-deftest gnus-icalendar-dtstart-only-datetime ()
+  ""
+
+  (let ((tz (getenv "TZ"))
+        (event (gnus-icalendar-tests--get-ical-event "\
+BEGIN:VCALENDAR
+PRODID:-//Google Inc//Google Calendar 70.9054//EN
+VERSION:2.0
+CALSCALE:GREGORIAN
+METHOD:REQUEST
+BEGIN:VTIMEZONE
+TZID:Europe/Berlin
+X-LIC-LOCATION:Europe/Berlin
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=3DYEARLY;BYMONTH=3D3;BYDAY=3D-1SU
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=3DYEARLY;BYMONTH=3D10;BYDAY=3D-1SU
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTART;TZID=3DEurope/Berlin:20200915T140000
+RRULE:FREQ=3DWEEKLY;BYDAY=3DFR,MO,TH,TU,WE
+DTSTAMP:20200915T120627Z
+ORGANIZER;CN=3Danon@HIDDEN:mailto:anon@HIDDEN
+UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@HIDDEN
+ATTENDEE;CUTYPE=3DINDIVIDUAL;PARTSTAT=3DACCEPTED;RSVP=3DTRUE
+ ;CN=3Dparticipant@HIDDEN;X-NUM-GUESTS=3D0:mailto:participant@ano=
ncompany.com
+CREATED:20200325T095723Z
+DESCRIPTION:Coffee talk
+LAST-MODIFIED:20200915T120623Z
+LOCATION:
+SEQUENCE:0
+STATUS:CONFIRMED
+SUMMARY:Casual coffee talk
+TRANSP:OPAQUE
+END:VEVENT
+END:VCALENDAR" (list "participant@HIDDEN"))))
+
+    (unwind-protect
+        (progn
+          ;; Use this form so as not to rely on system tz database.
+          ;; Eg hydra.nixos.org.
+          (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
+          (should (eq (eieio-object-class event) 'gnus-icalendar-event-req=
uest))
+          (should (gnus-icalendar-event:recurring-p event))
+          (should (string=3D (gnus-icalendar-event:recurring-interval even=
t) "1"))
+          (should (string=3D (gnus-icalendar-event:start event) "2020-09-1=
5 14:00"))
+          ;; For cases where a "VEVENT" calendar component specifies a
+          ;; "DTSTART" property with a DATE-TIME value type but no
+          ;; "DTEND" property, the event ends on the same calendar
+          ;; date and time of day specified by the "DTSTART" property.
+          (should (string=3D (gnus-icalendar-event:end event) "2020-09-15 =
14:00"))
+          (with-slots (organizer summary description location end-time uid=
 rsvp participation-type) event
+            (should (string=3D organizer "anon@HIDDEN"))
+            (should (string=3D summary "Casual coffee talk"))
+            (should (string=3D description "Coffee talk"))
+            (should (string=3D location ""))
+            (should (string=3D (format-time-string "%Y-%m-%d %H:%M" end-ti=
me) "2020-09-15 14:00"))
+            (should (string=3D uid "7b6g3m7iftuo90ei4ul00feqn_R20200915T12=
0000@HIDDEN"))
+            (should rsvp)
+            (should (eq participation-type 'required)))
+          (should (equal (sort (gnus-icalendar-event:recurring-days event)=
 #'<) '(1 2 3 4 5)))
+          (should (string=3D (gnus-icalendar-event:org-timestamp event) "<=
2020-09-15 14:00-14:00 +1w>
+<2020-09-16 14:00-14:00 +1w>
+<2020-09-17 14:00-14:00 +1w>
+<2020-09-18 14:00-14:00 +1w>
+<2020-09-21 14:00-14:00 +1w>"))
+
+          )
+      (setenv "TZ" tz))))
+
+(ert-deftest gnus-icalendar-dtstart-only-date ()
+  ""
+
+  (let ((tz (getenv "TZ"))
+        (event (gnus-icalendar-tests--get-ical-event "\
+BEGIN:VCALENDAR
+PRODID:-//Google Inc//Google Calendar 70.9054//EN
+VERSION:2.0
+CALSCALE:GREGORIAN
+METHOD:REQUEST
+BEGIN:VTIMEZONE
+TZID:Europe/Berlin
+X-LIC-LOCATION:Europe/Berlin
+BEGIN:DAYLIGHT
+TZOFFSETFROM:+0100
+TZOFFSETTO:+0200
+TZNAME:CEST
+DTSTART:19700329T020000
+RRULE:FREQ=3DYEARLY;BYMONTH=3D3;BYDAY=3D-1SU
+END:DAYLIGHT
+BEGIN:STANDARD
+TZOFFSETFROM:+0200
+TZOFFSETTO:+0100
+TZNAME:CET
+DTSTART:19701025T030000
+RRULE:FREQ=3DYEARLY;BYMONTH=3D10;BYDAY=3D-1SU
+END:STANDARD
+END:VTIMEZONE
+BEGIN:VEVENT
+DTSTART;TZID=3DEurope/Berlin:20200915
+RRULE:FREQ=3DWEEKLY;BYDAY=3DFR,MO,TH,TU,WE
+DTSTAMP:20200915T120627Z
+ORGANIZER;CN=3Danon@HIDDEN:mailto:anon@HIDDEN
+UID:7b6g3m7iftuo90ei4ul00feqn_R20200915T120000@HIDDEN
+ATTENDEE;CUTYPE=3DINDIVIDUAL;PARTSTAT=3DACCEPTED;RSVP=3DTRUE
+ ;CN=3Dparticipant@HIDDEN;X-NUM-GUESTS=3D0:mailto:participant@ano=
ncompany.com
+CREATED:20200325T095723Z
+DESCRIPTION:Coffee talk
+LAST-MODIFIED:20200915T120623Z
+LOCATION:
+SEQUENCE:0
+STATUS:CONFIRMED
+SUMMARY:Casual coffee talk
+TRANSP:OPAQUE
+END:VEVENT
+END:VCALENDAR" (list "participant@HIDDEN"))))
+
+    (unwind-protect
+        (progn
+          ;; Use this form so as not to rely on system tz database.
+          ;; Eg hydra.nixos.org.
+          (setenv "TZ" "CET-1CEST,M3.5.0/2,M10.5.0/3")
+          (should (eq (eieio-object-class event) 'gnus-icalendar-event-req=
uest))
+          (should (gnus-icalendar-event:recurring-p event))
+          (should (string=3D (gnus-icalendar-event:recurring-interval even=
t) "1"))
+          (should (string=3D (gnus-icalendar-event:start event) "2020-09-1=
5 00:00"))
+          ;; For cases where a "VEVENT" calendar component
+          ;; specifies a "DTSTART" property with a DATE value type but no
+          ;; "DTEND" nor "DURATION" property, the event's duration is take=
n to
+          ;; be one day.
+          (should (string=3D (gnus-icalendar-event:end event) "2020-09-16 =
00:00"))
+          (with-slots (organizer summary description location end-time uid=
 rsvp participation-type) event
+            (should (string=3D organizer "anon@HIDDEN"))
+            (should (string=3D summary "Casual coffee talk"))
+            (should (string=3D description "Coffee talk"))
+            (should (string=3D location ""))
+            (should (string=3D (format-time-string "%Y-%m-%d %H:%M" end-ti=
me) "2020-09-16 00:00"))
+            (should (string=3D uid "7b6g3m7iftuo90ei4ul00feqn_R20200915T12=
0000@HIDDEN"))
+            (should rsvp)
+            (should (eq participation-type 'required)))
+          (should (equal (sort (gnus-icalendar-event:recurring-days event)=
 #'<) '(1 2 3 4 5)))
+          (should (string=3D (gnus-icalendar-event:org-timestamp event) "<=
2020-09-15 00:00-00:00 +1w>
+<2020-09-16 00:00-00:00 +1w>
+<2020-09-17 00:00-00:00 +1w>
+<2020-09-18 00:00-00:00 +1w>
+<2020-09-21 00:00-00:00 +1w>"))
+
+          )
+      (setenv "TZ" tz))))
+
 (provide 'gnus-icalendar-tests)
 ;;; gnus-icalendar-tests.el ends here
=2D-=20
2.35.2


--==-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0004-lisp-gnus-gnus-icalendar-Add-gnus-icalendar-event-en.patch
Content-Transfer-Encoding: quoted-printable

From=207134ca9ecadf60efbe703ffd2203d25aada7fdfa Mon Sep 17 00:00:00 2001
From: John Hamelink <me@HIDDEN>
Date: Fri, 15 Apr 2022 02:51:11 +0100
Subject: [PATCH 4/5] lisp/gnus/gnus-icalendar: Add gnus-icalendar-event:end

=2D--
 lisp/gnus/gnus-icalendar.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 221d98c63a..036832e1d5 100644
=2D-- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -159,6 +159,9 @@ gnus-icalendar-event:recurring-days
 (cl-defmethod gnus-icalendar-event:start ((event gnus-icalendar-event))
   (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:start-time ev=
ent)))
=20
+(cl-defmethod gnus-icalendar-event:end ((event gnus-icalendar-event))
+  (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:end-time even=
t)))
+
 (defun gnus-icalendar-event--decode-duration (event field)
   (let ((duration (icalendar--get-event-property event field)))
     (unless (null duration)
=2D-=20
2.35.2


--==-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0003-lisp-gnus-gnus-icalendar-Add-gnus-icalendar-event-de.patch
Content-Transfer-Encoding: quoted-printable

From=206245118d273eb7672849fa31e3eb4f3992a6237b Mon Sep 17 00:00:00 2001
From: John Hamelink <me@HIDDEN>
Date: Fri, 15 Apr 2022 02:49:55 +0100
Subject: [PATCH 3/5] lisp/gnus/gnus-icalendar: Add
 gnus-icalendar-event--decode-duration

=2D--
 lisp/gnus/gnus-icalendar.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 8eb3172e01..221d98c63a 100644
=2D-- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -159,6 +159,11 @@ gnus-icalendar-event:recurring-days
 (cl-defmethod gnus-icalendar-event:start ((event gnus-icalendar-event))
   (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:start-time ev=
ent)))
=20
+(defun gnus-icalendar-event--decode-duration (event field)
+  (let ((duration (icalendar--get-event-property event field)))
+    (unless (null duration)
+      (icalendar--decode-isoduration duration))))
+
 (defun gnus-icalendar-event--decode-datefield (event field zone-map)
   (let* ((dtdate (icalendar--get-event-property event field))
          (dtdate-zone (icalendar--find-time-zone
=2D-=20
2.35.2


--==-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0003-lisp-gnus-gnus-icalendar-Add-gnus-icalendar-event-de.patch
Content-Transfer-Encoding: quoted-printable

From=206245118d273eb7672849fa31e3eb4f3992a6237b Mon Sep 17 00:00:00 2001
From: John Hamelink <me@HIDDEN>
Date: Fri, 15 Apr 2022 02:49:55 +0100
Subject: [PATCH 3/5] lisp/gnus/gnus-icalendar: Add
 gnus-icalendar-event--decode-duration

=2D--
 lisp/gnus/gnus-icalendar.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 8eb3172e01..221d98c63a 100644
=2D-- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -159,6 +159,11 @@ gnus-icalendar-event:recurring-days
 (cl-defmethod gnus-icalendar-event:start ((event gnus-icalendar-event))
   (format-time-string "%Y-%m-%d %H:%M" (gnus-icalendar-event:start-time ev=
ent)))
=20
+(defun gnus-icalendar-event--decode-duration (event field)
+  (let ((duration (icalendar--get-event-property event field)))
+    (unless (null duration)
+      (icalendar--decode-isoduration duration))))
+
 (defun gnus-icalendar-event--decode-datefield (event field zone-map)
   (let* ((dtdate (icalendar--get-event-property event field))
          (dtdate-zone (icalendar--find-time-zone
=2D-=20
2.35.2


--==-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0002-lisp-gnus-gnus-icalendar-Return-nil-if-datefield-cou.patch
Content-Transfer-Encoding: quoted-printable

From=20d46a3e9982eb771255aad802d401c540995c79ac Mon Sep 17 00:00:00 2001
From: John Hamelink <me@HIDDEN>
Date: Fri, 15 Apr 2022 02:40:45 +0100
Subject: [PATCH 2/5] lisp/gnus/gnus-icalendar: Return nil if datefield coul=
dnt
 be decoded

=2D--
 lisp/gnus/gnus-icalendar.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 7d4a98e034..8eb3172e01 100644
=2D-- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -165,7 +165,8 @@ gnus-icalendar-event--decode-datefield
                        (icalendar--get-event-property-attributes
                         event field) zone-map))
          (dtdate-dec (icalendar--decode-isodatetime dtdate nil dtdate-zone=
)))
=2D    (encode-time dtdate-dec)))
+    (unless (null dtdate-dec)
+      (encode-time dtdate-dec))))
=20
 (defun gnus-icalendar-event--find-attendee (ical name-or-email)
   (let* ((event (car (icalendar--all-events ical)))
=2D-=20
2.35.2


--==-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-lisp-gnus-gnus-icalendar-Added-date-and-datetime-pre.patch
Content-Transfer-Encoding: quoted-printable

From=208de7d6f33199d136d05226548db776fc7b64f59e Mon Sep 17 00:00:00 2001
From: John Hamelink <me@HIDDEN>
Date: Fri, 15 Apr 2022 02:35:05 +0100
Subject: [PATCH 1/5] lisp/gnus/gnus-icalendar: Added date and datetime
 predicates

RFC5545 states that the end-time should be calculated differently
depending on whether DTSTART is a date or a date-time.
=2D--
 lisp/gnus/gnus-icalendar.el            | 14 ++++++++++++++
 test/lisp/gnus/gnus-icalendar-tests.el | 26 ++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 1bffdf3513..7d4a98e034 100644
=2D-- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -214,6 +214,20 @@ gnus-icalendar-event--get-attendee-names
        (attendee-names-by-type "REQ-PARTICIPANT")
        (attendee-names-by-type "OPT-PARTICIPANT")))))
=20
+(defun gnus-icalendar--datep (date)
+  "return t if DATE matches a date list."
+  (and (length=3D date 9)
+       (length=3D
+        (seq-filter 'integerp (seq-take date 6))
+        3)))
+
+(defun gnus-icalendar--datetimep (datetime)
+  "Return t if DATETIME matches a date-time list."
+  (and (length=3D datetime 9)
+   (length=3D
+    (seq-filter 'integerp (seq-take datetime 6))
+    6)))
+
 (defun gnus-icalendar-event-from-ical (ical &optional attendee-name-or-ema=
il)
   (let* ((event (car (icalendar--all-events ical)))
          (organizer (replace-regexp-in-string
diff --git a/test/lisp/gnus/gnus-icalendar-tests.el b/test/lisp/gnus/gnus-i=
calendar-tests.el
index 348ddf9f05..5fecfd3773 100644
=2D-- a/test/lisp/gnus/gnus-icalendar-tests.el
+++ b/test/lisp/gnus/gnus-icalendar-tests.el
@@ -38,6 +38,32 @@ gnus-icalendar-tests--get-ical-event
       (setq event (gnus-icalendar-event-from-buffer (buffer-name) particip=
ant)))
     event))
=20
+(ert-deftest gnus-icalendar-datetimep ()
+  "Can differentiate between dates and datetimes."
+  (should
+   (equal
+    (gnus-icalendar--datetimep
+     (parse-time-string "2020-09-15 14:00"))
+    t))
+  (should
+   (equal
+    (gnus-icalendar--datetimep
+     (iso8601-parse-date "2020-09-15"))
+    nil)))
+
+(ert-deftest gnus-icalendar-datep ()
+  "Can differentiate between dates and datetimes."
+  (should
+   (equal
+    (gnus-icalendar--datep
+     (iso8601-parse-date "2020-09-15"))
+    t))
+  (should
+   (equal
+    (gnus-icalendar--datep
+     (parse-time-string "2020-09-15 14:00"))
+    nil)))
+
 (ert-deftest gnus-icalendar-parse ()
   "test"
   (let ((tz (getenv "TZ"))
=2D-=20
2.35.2


--==-=-=--

--=-=-=--

--===-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEE+Yt/N+nvP8wO2AcVFT3f6aVKmkwFAmJZQ5YRHG1lQGpvaG5o
YW1lLmxpbmsACgkQFT3f6aVKmky5hhAApQ/0kMCBn8RcuCVDJWBwavhg0qMl4Cak
Yy0wilIJW0RH5tFzKTVGQe56o6MaqE+0z4N2pWaCJRQqK/LFGcYqIH9CbSxIBb+k
4zKJUhb03hcF3Tzeh0ObENpInC3XdeNUfG0sYV8ozVCfUKuElfZSqIwn8tawFrGl
f6/EGic53D2wiIDVc1NDi3U6SksoIaq0v40P0sLPsTjEE2Knje6hhDK84wLlA4WV
2RS/ZuvfJu7gcuJAGeuHYp9auE/+14o5aO+SOGfJid9KY8CfM7oQyldALdzqmAS9
pZqWiNYU/BzoSjVRxYEg37q6gr//bwMS4jqYBOSk/Jvk5lKTpac+cxsmbxv+V1e7
M2j7tTnC35IOEN5AvdwpPw/9scajtsoGwK/y2/0fdAuqG5IqgafqJDrpecVCS5oS
WcSupR0Twlt3U+HbcxeQ88ccF55mws8Lt/v3kbheOgx/iVBtpZA+MGsK9DplNHhw
9QD82QE9FQpbLRZWSfVbP//oGDzGgeMKXQiDYqPsu/Yp8LBDkXCnQyxVelm+D/Pu
hDBZcpCyZp9Ac7k96GtrUIVE7skYN14l4Gmz6Jx1a81jaP2pNghZKMXOVWHapHSr
WPDR1kSSFtOdMsIYOWa+sjjs1Sic68ZnqesvxxLllLOJc/zO0fD5gRePgUnQqJd6
NcKNTIoW4r4=
=p7x2
-----END PGP SIGNATURE-----
--===-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54939; Package emacs. Full text available.

Message received at 54939 <at> debbugs.gnu.org:


Received: (at 54939) by debbugs.gnu.org; 14 Apr 2022 19:13:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 14 15:13:24 2022
Received: from localhost ([127.0.0.1]:57390 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nf4uC-0000Z3-Kz
	for submit <at> debbugs.gnu.org; Thu, 14 Apr 2022 15:13:24 -0400
Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42059)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1nf4uB-0000Yr-9b
 for 54939 <at> debbugs.gnu.org; Thu, 14 Apr 2022 15:13:23 -0400
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 2838C5C0327
 for <54939 <at> debbugs.gnu.org>; Thu, 14 Apr 2022 15:13:18 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Thu, 14 Apr 2022 15:13:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnhame.link;
 h=cc:content-type:date:date:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:sender:subject
 :subject:to:to; s=fm3; t=1649963598; x=1650049998; bh=lM8Gozw5XQ
 FyLT1oM6XZVkNl5HjH4QhoGXszbsTTXW0=; b=NKTFVCgrnsTFbJ2LUk9z8ZpGYN
 /krvZLLpc/ySq0G5Mk5ULgdfcWu73wjc8LipmoWU15TSE2mKHIJtyq2TQ2rzA5cS
 W5AgFKw+XehZWUN7sPmjRSwD8UfT/EpQqigrdqlNk7UFiyQGhTBk1+CGEJR3lXq8
 efGnE9yvwPT94umYGo67dYkA1zKFrvkBs3oDuo1zTCoaViyPiWLsj2hPE33z2wXj
 4meKAUAXNmoPo++Ek723vI8rgdUYVdjCmbT+s/hUsCEVEBNrdXpGv0SrJFX2wDYk
 88BHNsAPpnsqRWsJQRl+zDkPrlBK1eSHsEI4KRK0mZPrjnEkbuBE5280K7Qw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1649963598; x=
 1650049998; bh=lM8Gozw5XQFyLT1oM6XZVkNl5HjH4QhoGXszbsTTXW0=; b=v
 gxPNRvR9mWyA8gDs51P2daOzwub1ghWBwnnqxCSTVG8VEwuIXZUzSMee/vY47Jpy
 5tQM+dHq3XPXw58EID3fZUL3JzhNeOzTDpFjUWWKF4gLdF3JkKP/zyZIOuuCgQIX
 9meQnXzXVEGJ2qf6p3rphXxsGcjvZJhu2ROBHr9CsJmwyMHke77hLgTumhNS+hO2
 hCLGt4Bafcqjl1gF0zq2I7F3nWakgixFi+EiAZFQwTTXI5BRXyFHxLlmrqGsDsb6
 A9qwVKWnnnzE+cqARfXsFjCG31gfgmNVO/vmWyIcMiGmyE17iazBE8otQeDJoWIv
 OEv1riVEkG7fpcdM9AH/Q==
X-ME-Sender: <xms:TXJYYiLJDu45tF_JKexvboCfrZHJgkj5TvJ5ropGJbTy3wSFZYrD6A>
 <xme:TXJYYqJLTtS6V2A5i_doUSSEep2zOZFCwBOXUJYT9F625dQ9Ax8ebT8wzCtzOHNPn
 WdDShKjLPHbrQ7qyA>
X-ME-Received: <xmr:TXJYYisYAuqWzp_3iEIhg1_1LDbW2Mg8chWSq_D6ZqytWoXGdjWyUfFEEcY>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelfedgudefjecutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvuffffhgfjgfkgggtsehgtd
 erredtredtnecuhfhrohhmpeflohhhnhcujfgrmhgvlhhinhhkuceomhgvsehjohhhnhhh
 rghmvgdrlhhinhhkqeenucggtffrrghtthgvrhhnpedukefgtedvgeffieeliefggefhte
 dtgeffleetudehveeiffelieegveduvdehkeenucevlhhushhtvghrufhiiigvpedtnecu
 rfgrrhgrmhepmhgrihhlfhhrohhmpehmvgesjhhohhhnhhgrmhgvrdhlihhnkh
X-ME-Proxy: <xmx:TXJYYnZYIlvC64fvqx3hEAC9u0Z8LcXYfWF0e9x5Rv_FSQE3L6XWoA>
 <xmx:TXJYYpZyJcZRJemZRRpV48x18_QNAdyuN5PgofVo49GyQO5BprcRXA>
 <xmx:TXJYYjAqEzrxvld2FTH_f652SlZJCiv8fY7n9Px8NOJs8U1hd7-CyQ>
 <xmx:TnJYYr2QP_vmFurGimwGwnRyEDajPtjrgq75FUgBzu6iluJA0j-bwg>
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <54939 <at> debbugs.gnu.org>; Thu, 14 Apr 2022 15:13:17 -0400 (EDT)
From: John Hamelink <me@HIDDEN>
To: 54939 <at> debbugs.gnu.org
Subject: Re: bug#54939: 29.0.50; icalendar cannot infer the DTEND from
 DTSTART + DURATION
Date: Thu, 14 Apr 2022 20:09:24 +0100
References: <87fsmfoi0f.fsf@HIDDEN> <87v8vbk97u.fsf@HIDDEN>
User-agent: mu4e 1.6.10; emacs 29.0.50
In-reply-to: <87v8vbk97u.fsf@HIDDEN>
Message-ID: <87fsmf32d0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="===-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 54939
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--===-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: multipart/mixed; boundary="==-=-="

--==-=-=
Content-Type: text/plain
Content-Disposition: inline

>> How does that sound?
>
> Makes sense to me.

Great, then I'll have a crack at writing such a patch. I'm new to
Emacs lisp, but this seems to me like a manageable first task!

JH

--==-=-=--

--=-=-=--

--===-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEE+Yt/N+nvP8wO2AcVFT3f6aVKmkwFAmJYcksRHG1lQGpvaG5o
YW1lLmxpbmsACgkQFT3f6aVKmkzlFQ//eZ5wwBQOR6f0Ru7M1ftOIkYRHNKU3a2f
tSjawfUOM4Y5LL9Y3kl3YNcBNXEOPgOxAvLFIsbm1rOrgT3WqMNPA27y9xURnGky
cKYGOPQOVb/fkG222lCxUw9MEvq/+8V8dnB5lcOUGnNZ7kdoorF6dh6zRhwT9Hk2
61UQBLXy5fLhoXVwV5322YBggMhvlQmp4KqTz0SssCosRMUP5pdZyNqk09fvqDDs
SB5f9nfqqlNnXsM+OOv0+7NqVF7BoeoW+r8D99XK4rWgoYNEAfqQypQP3bOf5IoH
ADx9AvTzKXUtpE6AITWermqgd4rby6tAR/ObybnCwkT58XSWMl0/TLPFURoEpinX
GuZEA4nuRxjThF5SI83iHyrrtP1jpz3ATfwJhSC/ctrJ9PCVkL7KuKM/dw/gt9R3
0Y65ynepfs7WZTS7OZRW6aZzCl3CMezFJwuAiiWerxrstO2KMet+kkMXYn63IOgq
i4C05U7pt37SsfFyHn8hQnThs1+hqTbghFkrtY5gyhJKVyfnBlhYbDKR6KRhyUS4
/IKtY+mIUeswq1CldAVw3Eg32WscanO+Phj6bkZk0dSZfJgNMTpL5LPv4gkikua8
amuUore6WvMLTK6lh14eKzJ/xiHTG2Yi0HK+/DaSlgkmY7lIme4jDm4SGle/XpQc
sGh7bTfmiTI=
=qSrF
-----END PGP SIGNATURE-----
--===-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54939; Package emacs. Full text available.

Message received at 54939 <at> debbugs.gnu.org:


Received: (at 54939) by debbugs.gnu.org; 14 Apr 2022 14:53:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 14 10:53:22 2022
Received: from localhost ([127.0.0.1]:56942 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nf0qX-0001b3-Tq
	for submit <at> debbugs.gnu.org; Thu, 14 Apr 2022 10:53:22 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41596)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1nf0qW-0001ao-04
 for 54939 <at> debbugs.gnu.org; Thu, 14 Apr 2022 10:53:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To: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=PEH+YySTJcvOJgaTw1gNpbnsjq5XPePRx2IYMjSL8C8=; b=hzZOsr1UnUdxOnmEX/XeUvWl0S
 1TVaNq7c7CH13ThYUHCof+ttg3LArGQtoyPqH/5OCIygXMtH17sGQ4zbE96g9eStsWw85WZx8N4Hj
 G9brkynDuCL5mpKD+Hze9Dmk+bUrm0Z8EqgvS0H7fo6ewzccOBrQMVornqNACD7Bnd/k=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1nf0qM-0002xF-Q6; Thu, 14 Apr 2022 16:53:13 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: John Hamelink <me@HIDDEN>
Subject: Re: bug#54939: 29.0.50; icalendar cannot infer the DTEND from
 DTSTART + DURATION
References: <87fsmfoi0f.fsf@HIDDEN>
Date: Thu, 14 Apr 2022 16:53:09 +0200
In-Reply-To: <87fsmfoi0f.fsf@HIDDEN> (John Hamelink's message of "Thu, 
 14 Apr 2022 14:44:16 +0100")
Message-ID: <87v8vbk97u.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  John Hamelink <me@HIDDEN> writes: > So, I propose we
 build a function that either returns the end-time using > DTEND as is
 currently
 the case, or else to add DTSTART + DURATION and > use that as DTEND if one
 doesn't exist, or else to [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54939
Cc: 54939 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

John Hamelink <me@HIDDEN> writes:

> So, I propose we build a function that either returns the end-time using
> DTEND as is currently the case, or else to add DTSTART + DURATION and
> use that as DTEND if one doesn't exist, or else to use DTSTART + 1 Day
> if DTSTART is a date, or else to use DTSTART if DTSTART is a datetime.
>
> How does that sound?

Makes sense to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54939; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Apr 2022 14:29:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 14 10:29:59 2022
Received: from localhost ([127.0.0.1]:56915 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nf0Tr-0000xH-2K
	for submit <at> debbugs.gnu.org; Thu, 14 Apr 2022 10:29:59 -0400
Received: from lists.gnu.org ([209.51.188.17]:56446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1nf0Tp-0000x9-AL
 for submit <at> debbugs.gnu.org; Thu, 14 Apr 2022 10:29:53 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48290)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1nf0Tp-00024B-44
 for bug-gnu-emacs@HIDDEN; Thu, 14 Apr 2022 10:29:53 -0400
Received: from out5-smtp.messagingengine.com ([66.111.4.29]:40663)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1nf0Tm-0003ae-Sb
 for bug-gnu-emacs@HIDDEN; Thu, 14 Apr 2022 10:29:52 -0400
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailout.nyi.internal (Postfix) with ESMTP id EB9F65C02EC
 for <bug-gnu-emacs@HIDDEN>; Thu, 14 Apr 2022 10:29:48 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Thu, 14 Apr 2022 10:29:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnhame.link;
 h=cc:content-type:date:date:from:from:in-reply-to:message-id
 :mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=
 1649946588; x=1650032988; bh=uLnI8o1smZhm3r2iSj6mhMWaw33Ujee9Ugy
 RO0T6kEk=; b=lEO3jDEzSVbwnEDiYHmSQ66zf8Vj6SVWnmAqTbUfEXMi0enmaTc
 mUNBMeoiDqae/PObABAAnh2b/GC2cc5fBeRXKXJGG2MVoCGsYZDmYPG9QRrIZIbR
 JX3xAXABQ292W34VJ9ytQvzGeIdOZMCn5VfDvjeAxs4IxN2ggUKUAOFxRmdTTWmo
 hW02Se7qfxjtb4X94GzqfWRZOBzKmEXVSzWha/rYCZv2fTmGuWhpCgHo7NOdD9K0
 LwawA6YwaAUZ4/Klb1Ej3jQBJFTe7702/Hqbqg61segn5WLEqEgggheC1jg71Jox
 HUkEhimO+OEII3B52pJiSEIkzHb+hSr30UA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:date:from:from
 :in-reply-to:message-id:mime-version:reply-to:sender:subject
 :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; t=1649946588; x=1650032988; bh=uLnI8o1smZhm3
 r2iSj6mhMWaw33Ujee9UgyRO0T6kEk=; b=D+V+yyvO4Lr6/hmiwhks4arcduP57
 rDfhxg0x4Wy9NM+/ReE3Q6fxkLdvJ7WEtmAP4b8hUhgBcchpxIFMqMe+Sd/zcS/Z
 nctHNQkOI6tKfd41yeEtX56WeZ0bf5j7EWQxKlSJNudCziF5oZbivMuavJt3vNFY
 Bg0R4Xlp3H3/tXG7iiWAK4SsNxcs/V8CBVi9Rm6xsGC6hZglX6b/gtL/56dmO5vc
 BfmNwI5BaIkTc14+gzq1t7phBwPBlJ0t5+rFytx6QjSPwk6HL/K443SbxaLZ1kXK
 KBNBPiq4vB0J1+my5KFs46EB76USLS0+A1ukppSLO+PfNgBEQpR6+Lz6w==
X-ME-Sender: <xms:3C9YYgwK0BvqM3GxlIiQ7tyDauVn2FvRypsLtv76njoeHPjlMNmU5g>
 <xme:3C9YYkQrobPec8gWzSYySzQgy_S4RhjwQXp-8H5Li38ILBaMlA-hPZSYwBzEflTTR
 aWpWQgNy_DB4DHD2w>
X-ME-Received: <xmr:3C9YYiXcjhp409WwEO1KR8PFOdS0Bq7hJFVZ2kcuFr14NUW9uMzqZXUZ3kE>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelfedgjeejucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucenucfjughrpegfhffvufffkfggtgesghdtreertd
 ertdenucfhrhhomheplfhohhhnucfjrghmvghlihhnkhcuoehmvgesjhhohhhnhhgrmhgv
 rdhlihhnkheqnecuggftrfgrthhtvghrnhepledvhffhffffgfejheeufedvgeejffevge
 elgfethfdtleehveekjeekheeguddtnecuffhomhgrihhnpegthihruhhsihhmrghprdho
 rhhgpdgrghgvnhgurgdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh
 epmhgrihhlfhhrohhmpehmvgesjhhohhhnhhgrmhgvrdhlihhnkh
X-ME-Proxy: <xmx:3C9YYuhlnPWDMR6WtoE-Pbh-7_yOgVz5rSLmajGTwyuWMte2-jpqPA>
 <xmx:3C9YYiCYSXW8lXZXgae8ayG-4tl_SaR68kvZdsk398wM2OboYSXkZA>
 <xmx:3C9YYvIhaY1QJ6ifiMy1rsgJd5cQXCjJ3LE9mOIJhHB9Aoi6ltL7lg>
 <xmx:3C9YYp8CPi6Ts_h7kW3d9NHI2pVfVPS_mime9qNT08IYT1tx2ju9ig>
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <bug-gnu-emacs@HIDDEN>; Thu, 14 Apr 2022 10:29:48 -0400 (EDT)
User-agent: mu4e 1.6.10; emacs 29.0.50
From: John Hamelink <me@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50; icalendar cannot infer the DTEND from DTSTART + DURATION
Date: Thu, 14 Apr 2022 14:44:16 +0100
Message-ID: <87fsmfoi0f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
Received-SPF: pass client-ip=66.111.4.29; envelope-from=me@HIDDEN;
 helo=out5-smtp.messagingengine.com
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,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.7 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

--=-=-=
Content-Type: text/plain; format=flowed

Hi there,

As part of my ongoing efforts to move entirely to Emacs for email, I've
discovered an incompatibility with calendar invites sent by Fastmail.

After triggering `mu4e-headers-view-message' from `mu4e-headers-mode', I
receive the following:

    Debugger entered--Lisp error: (wrong-type-argument consp nil)
    gnus-icalendar-event--decode-datefield((VEVENT nil ((UID nil
    "064fa1da-e6f1-4463-9f5d-97217cde2c17") (SEQUENCE nil "1") (DTSTAMP
    nil "20220414T130209Z") (CREATED nil "20220414T130209Z") (DTSTART
    (TZID "Europe/London") "20220415T090000") (DURATION nil "PT1H")
    (PRIORITY nil "0") (SUMMARY nil "Demo Event") (STATUS nil "CONFIRMED")
    (TRANSP nil "OPAQUE") (ORGANIZER (X-JMAP-ID "bWVAam9obmhhbWUubGluaw"
    CN "John Hamelink" EMAIL "me@HIDDEN")
    "mailto:me@HIDDEN") (ATTENDEE (X-JMAP-ID
    "bWVAam9obmhhbWUubGluaw" CN "John Hamelink" EMAIL "me@HIDDEN"
    CUTYPE "INDIVIDUAL" X-JMAP-ROLE "owner" X-JMAP-ROLE "attendee"
    PARTSTAT "ACCEPTED" RSVP "FALSE") "mailto:me@HIDDEN") (ATTENDEE
    (X-JMAP-ID "am9obkBtZWRpY2NyZWF0aW9ucy5jb20" CN "John Hamelink" EMAIL
    "john@HIDDEN" CUTYPE "INDIVIDUAL" X-JMAP-ROLE "attendee" PARTSTAT
    "NEEDS-ACTION" RSVP "TRUE") "mailto:john@HIDDEN")) nil) DTEND
    (("Europe/London"
    . "STD-00:00DST-01:00,M3.5.0/01:00:00,M10.5.0/02:00:00")))

This makes sense, because on inspection of the ics file, we see that
DTEND is not part of the file (I added indentation to clarify scope):

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//CyrusIMAP.org/Cyrus=20
    3.7.0-alpha0-387-g7ea99c4045-fm-20220413.002-g7ea99c40//EN
    METHOD:REQUEST
    CALSCALE:GREGORIAN
    BEGIN:VTIMEZONE
        TZID:Europe/London
        LAST-MODIFIED:20210816T175139Z
        X-LIC-LOCATION:Europe/London
        TZUNTIL:20220415T090000Z
        BEGIN:DAYLIGHT
            TZNAME:BST
            TZOFFSETFROM:+0000
            TZOFFSETTO:+0100
            DTSTART:19810329T010000
            RRULE:FREQ=3DYEARLY;BYMONTH=3D3;BYDAY=3D-1SU
        END:DAYLIGHT
        BEGIN:STANDARD
            TZNAME:GMT
            TZOFFSETFROM:+0100
            TZOFFSETTO:+0000
            DTSTART:19961027T020000
            RRULE:FREQ=3DYEARLY;BYMONTH=3D10;BYDAY=3D-1SU
        END:STANDARD
    END:VTIMEZONE
    BEGIN:VEVENT
        UID:064fa1da-e6f1-4463-9f5d-97217cde2c17
        SEQUENCE:1
        DTSTAMP:20220414T130209Z
        CREATED:20220414T130209Z
        DTSTART;TZID=3DEurope/London:20220415T090000
        DURATION:PT1H
        PRIORITY:0
        SUMMARY:Demo Event
        STATUS:CONFIRMED
        TRANSP:OPAQUE
        ORGANIZER;X-JMAP-ID=3DbWVAam9obmhhbWUubGluaw;CN=3DJohn Hamelink;
        EMAIL=3Dme@HIDDEN:mailto:me@HIDDEN
        ATTENDEE;X-JMAP-ID=3DbWVAam9obmhhbWUubGluaw;CN=3DJohn Hamelink;
        EMAIL=3Dme@HIDDEN;CUTYPE=3DINDIVIDUAL;X-JMAP-ROLE=3Downer;
        X-JMAP-ROLE=3Dattendee;PARTSTAT=3DACCEPTED;RSVP=3DFALSE:mailto:
        me@HIDDEN
        ATTENDEE;X-JMAP-ID=3Dam9obkBtZWRpY2NyZWF0aW9ucy5jb20;CN=3DJohn Hamelink;
        EMAIL=3Djohn@HIDDEN;CUTYPE=3DINDIVIDUAL;X-JMAP-ROLE=3Dattendee;
        PARTSTAT=3DNEEDS-ACTION;RSVP=3DTRUE:mailto:john@HIDDEN
    END:VEVENT
    END:VCALENDAR

However, it seems that from the ics file we did receive, we should be
able to infer the DTEND value by simply adding DURATION to DTSTART.

I've been able to setup a minimal configuration which replicates the
problem using the icalendar file above (and without involving mu4e):

    (package-install 'gnus)
    (package-install 'org)

    (require 'gnus)
    (require 'gnus-icalendar)

    (setq-default gnus-icalendar-org-capture-file "/tmp/agenda.org"
                gnus-icalendar-org-capture-headline '("Calendar"))

    (gnus-icalendar-org-setup)

    (gnus-icalendar-event-from-ical
    '((VCALENDAR nil
            ((VERSION nil "2.0")
            (PRODID nil "-//CyrusIMAP.org/Cyrus 3.7.0-alpha0-387-g7ea99c4045-fm-20220413.002-g7ea99c40//EN")
            (METHOD nil "REQUEST")
            (CALSCALE nil "GREGORIAN"))
            ((VTIMEZONE nil
                        ((TZID nil "Europe/London")
                        (LAST-MODIFIED nil "20210816T175139Z")
                        (X-LIC-LOCATION nil "Europe/London")
                        (TZUNTIL nil "20220415T090000Z"))
                        ((DAYLIGHT nil (... ... ... ... ...) nil)
                        (STANDARD nil (... ... ... ... ...) nil)))
            (VEVENT nil (
                    (UID nil "064fa1da-e6f1-4463-9f5d-97217cde2c17")
                    (SEQUENCE nil "1")
                    (DTSTAMP nil "20220414T130209Z")
                    (CREATED nil "20220414T130209Z")
                    (DTSTART (TZID "Europe/London") "20220415T090000")
                    (DURATION nil "PT1H")
                    (PRIORITY nil "0")
                    (SUMMARY nil "Demo Event")
                    (STATUS nil "CONFIRMED")
                    (TRANSP nil "OPAQUE")
                    (ORGANIZER
                        (X-JMAP-ID "bWVAam9obmhhbWUubGluaw"
                         CN "John Hamelink"
                         EMAIL "me@HIDDEN") "mailto:me@HIDDEN")
                    (ATTENDEE
                        (X-JMAP-ID "bWVAam9obmhhbWUubGluaw"
                         CN "John Hamelink"
                         EMAIL "me@HIDDEN"
                         CUTYPE "INDIVIDUAL"
                         X-JMAP-ROLE "owner"
                         X-JMAP-ROLE "attendee"
                         PARTSTAT "ACCEPTED"
                         RSVP "FALSE") "mailto:me@HIDDEN")
                    (ATTENDEE
                        (X-JMAP-ID "am9obkBtZWRpY2NyZWF0aW9ucy5jb20"
                         CN "John Hamelink"
                         EMAIL "john@HIDDEN"
                         CUTYPE "INDIVIDUAL"
                         X-JMAP-ROLE "attendee"
                         PARTSTAT "NEEDS-ACTION"
                         RSVP "TRUE") "mailto:john@HIDDEN")) nil)))))


The part of the code which handles the end time is gnus-icalendar.el
line 246, where the code simply assumes that the DTEND property exists:

    :end-time (gnus-icalendar-event--decode-datefield event 'DTEND zone-map)

RFC5545 Section 3.6.1 (the iCalendar spec) says:

    ; Either 'dtend' or 'duration' MAY appear in
    ; a 'eventprop', but 'dtend' and 'duration'
    ; MUST NOT occur in the same 'eventprop'.

And further on:

    For cases where a "VEVENT" calendar component
    specifies a "DTSTART" property with a DATE value type but no
    "DTEND" nor "DURATION" property, the event's duration is taken to
    be one day.  For cases where a "VEVENT" calendar component
    specifies a "DTSTART" property with a DATE-TIME value type but no
    "DTEND" property, the event ends on the same calendar date and
    time of day specified by the "DTSTART" property.

So, I propose we build a function that either returns the end-time using
DTEND as is currently the case, or else to add DTSTART + DURATION and
use that as DTEND if one doesn't exist, or else to use DTSTART + 1 Day
if DTSTART is a date, or else to use DTSTART if DTSTART is a datetime.

How does that sound?

Best,
JH

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEE+Yt/N+nvP8wO2AcVFT3f6aVKmkwFAmJYL9oRHG1lQGpvaG5o
YW1lLmxpbmsACgkQFT3f6aVKmkxkMBAAvPHIsPzcQNrpJxmqmvsRDjxoi0Bx9jXe
XiBF/Netj4WxI7wY4S/Ln6NZ22sOzGJ60ICgDB1YgyUyQVfOUMDNc2xnfiKPm3X7
2MviAO5MiQm89UjUMNPKC1zIx5PwwshGWu4na+3chbpUnKWpat/mMpfdPBLvRMrH
ZphMlAlQ6ctal19hYRoWLijqKu4pbF3JdJQ4VcydFjeRTuco3HR3vcjjjWMURpSp
i1UuO5aI35pItb1M8FZKNLO8aAvbzvs5DDcqrnuEhnjfElHu9PNhbOleGhJ+7R75
kigpiVwRvE/36MNRgj6oRW+QWYQnmCaXJ5miitNki+eHG32S2m4tR3G95vYJKkVg
1NOrcsV6wiQUmGVS8bVwY02NBCbO+rtp3M63aOG4nX1S9NtLg/uBsbHf/nkssi59
oFIOJlp4D9t2dfGWpYzTbEIB3f/Fx2SO9NmgP90Ht36XSUmmEizUuz9E89vfSAfO
Op5C8NZUg4fodrOSBK/+uAtpvg8Hkq2qSXGTIvW3UejSd6AM6CuVmVyoC7ep+7iH
K6C+ay/B2zKR41SYpHfEup9v1expF0DA9DMP+zIUBwSAi0HMIh3UfSXoa/0WYZwF
Vh3mj0xz+zM8bVD7v3nOjEkWDMjbVjmXNAEghCLiysgTKDSaSJn1gfzhtpPrYQsz
ekVPQFHuR/8=
=P3mP
-----END PGP SIGNATURE-----
--=-=-=--




Acknowledgement sent to John Hamelink <me@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#54939; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 17 Apr 2022 18:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.