GNU bug report logs - #72831
[PATCH] gnus-icalendar: Allow comments in event replies

Previous Next

Package: emacs;

Reported by: Ferdinand Pieper <list_gnu <at> pie.tf>

Date: Tue, 27 Aug 2024 13:52:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 31.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ferdinand Pieper <list_gnu <at> pie.tf>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Andrew G Cohen <cohen <at> andy.bu.edu>, Alexandre Duret-Lutz <adl <at> lrde.epita.fr>, 72831 <at> debbugs.gnu.org
Subject: bug#72831: [PATCH] gnus-icalendar: Allow comments in event replies
Date: Wed, 28 Aug 2024 18:35:55 +0200
[Message part 1 (text/plain, inline)]
Thanks for the review.

Robert Pluim <rpluim <at> gmail.com> writes:

> Now that you have the bug number, please put (Bug#72831) somewhere in
> the commit message.

Updated in the patch attached. 

> I think a change this size requires copyright assigment, which I donʼt
> know if youʼve done.

Copyright assignment is done. I wrote some prior contributions to org-mode.

> I think that if youʼre making the same comment for the three functions
> you can put all three in one set of (), separated by commas.

Updated.

>     >> @@ -319,6 +319,10 @@ gnus-icalendar-event--build-reply-event-body
>     >> (if (string-match "^[^:]+:" line)
>     >> (replace-match (format "\\&%s: " summary-status) t nil line)
>     >> line))
>     >> +         (update-comment
>     >> +           (line)
>     >> +           (if comment (format "COMMENT:%s" comment)
>     >> +             line))
>     >> (update-dtstamp ()
>     >> (format-time-string "DTSTAMP:%Y%m%dT%H%M%SZ" nil t))
>     >> (attendee-matches-identity
>     >> @@ -341,6 +345,7 @@ gnus-icalendar-event--build-reply-event-body
>     >> (cond
>     >> ((string= key "ATTENDEE") (update-attendee-status line))
>     >> ((string= key "SUMMARY") (update-summary line))
>     >> +		     ((string= key "COMMENT") (update-comment line))
>     >> ((string= key "DTSTAMP") (update-dtstamp))
>     >> ((member key '("ORGANIZER" "DTSTART" "DTEND"
>     >> "LOCATION" "DURATION" "SEQUENCE"
>     >> @@ -363,12 +368,17 @@ gnus-icalendar-event--build-reply-event-body
>     >> attendee-status user-full-name user-mail-address)
>     >> reply-event-lines))
>     >> 
>     >> +      ;; add comment line if not existing
>     >> + (when (and comment (not (gnus-icalendar-find-if (lambda (x)
>     >> (string-match "^COMMENT" x))
>     >> + reply-event-lines)))
>     >> +        (push (format "COMMENT:%s" comment) reply-event-lines))
>     >> +
>
> So if the event was sent with a COMMENT the receiver canʼt add their
> own? That doesnʼt match my conception of 'reply with comment'. Iʼm
> hazy on whatʼs exactly allowed in ical, can you have more than one
> COMMENT line? Or we could combine the comments?

If it already exists it is replaced by the prior
>    >> ((string= key "COMMENT") (update-comment line))
Just if it does not exist the `(string= key "COMMENT")` never matches and we have to add the field.

>     >> -(defun gnus-icalendar-event-reply-from-buffer (buf status identities)
>     >> +(defun gnus-icalendar-event-reply-from-buffer (buf status
>     >> identities &optional comment)
>     >> "Build a calendar event reply for request contained in BUF.
>     >> The reply will have STATUS (`accepted', `tentative' or  `declined').
>     >> The reply will be composed for attendees matching any entry
>
> Could you describe the COMMENT arg in the docstring?

Updated.

>     >> @@ -1009,25 +1019,37 @@ gnus-icalendar-save-event
>     >> (when data
>     >> (gnus-icalendar-save-part data))))
>     >> 
>     >> -(defun gnus-icalendar-reply-accept ()
>     >> -  "Accept invitation in the current article."
>     >> +(defun gnus-icalendar-reply-accept (&optional comment-p)
>     >> +  "Accept invitation in the current article.
>     >> +
>     >> +With a prefix `\\[universal-argument]' prompt for a comment to include
>     >> +in the reply."
>
> I think we tend to word this as
>
> "Optional argument COMMENT-P (interactively the prefix argument) means
> prompt for a comment to include in the reply."

Updated using `\\[universal-argument]'. Or does that not matter here and just "prefix argument" would be fine?

> Ideally youʼd add test cases for this to
> "test/lisp/gnus/gnus-icalendar-tests.el". But thatʼs not mandatory.

I looked into it and will add a few tests for accepting/declining events with and without comments. I will followup on this in a couple days.
It might also make sense to extend the parsing of events to recognize comments (and potentially display them inside emacs.


I also missed to update the interactive argument for `gnus-icalendar-reply-accept` and `gnus-icalendar-reply-tentative`, which is now fixed in the updated patch.


Best,


[0001-Allow-comments-to-organizer-in-event-replies-bug-728.patch (text/x-patch, attachment)]

This bug report was last modified 249 days ago.

Previous Next


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