From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83934 Path: news.gmane.org!not-for-mail From: Jan Tatarik Newsgroups: gmane.emacs.gnus.general Subject: Re: PATCH: bugfix and improvements for gnus-icalendar Date: Thu, 28 Nov 2013 22:45:35 +0100 Message-ID: <87bo142oao.fsf@nb-jtatarik2.xing.hh> References: <87mwksgkm7.fsf@nb-jtatarik2.xing.hh> <87txeww82d.fsf@topper.koldfront.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1385675159 13061 80.91.229.3 (28 Nov 2013 21:45:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Nov 2013 21:45:59 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32189@lists.math.uh.edu Thu Nov 28 22:46:03 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vm9PO-0005n2-PL for ding-account@gmane.org; Thu, 28 Nov 2013 22:46:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Vm9P9-0005h6-S2; Thu, 28 Nov 2013 15:45:47 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Vm9P8-0005gs-0d for ding@lists.math.uh.edu; Thu, 28 Nov 2013 15:45:46 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1Vm9P6-0007U4-Dh for ding@lists.math.uh.edu; Thu, 28 Nov 2013 15:45:45 -0600 Original-Received: from mail-bk0-f52.google.com ([209.85.214.52]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1Vm9P5-0003X0-1q for ding@gnus.org; Thu, 28 Nov 2013 22:45:43 +0100 Original-Received: by mail-bk0-f52.google.com with SMTP id u14so3953678bkz.25 for ; Thu, 28 Nov 2013 13:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=DfgidC36MLo2Hq0+DVe/lMgC8k4SgF1QFWgcjlp+uKM=; b=BYmRmAPikEwhTjj4STeOI9H7mJJcq+UgMbUU4w/Uft/AWDcZBg6RFkbPF4GJM3GG8+ 6ayFBXZm8gqZvc6PrahQI1W+I9b3l5n/bij++EAYpOGGXA9JPh4QDVyNllR+McJaVqND qKKq9NpTHKAH0O4Oq8alX5MFNzBC/lCg1PaQ35SjuUI34eqELXgIvjGj9MrgZfWI5Pr6 kcWHSx9FKVJXw3zTNSlx8jRPiZmrkDOYimscvBfP9eP+HXigyYMpIMQmrMtlZ3jt/vF9 rXEZXTtSk/hEvJY0NLV0CjM7nS77kcn9ajB95pzlYgbao2etjGKJ1KcwKLbo5GSR6U3Q WgRQ== X-Received: by 10.204.96.203 with SMTP id i11mr10658bkn.56.1385675137677; Thu, 28 Nov 2013 13:45:37 -0800 (PST) Original-Received: from nb-jtatarik2.xing.hh (f054079226.adsl.alicedsl.de. [78.54.79.226]) by mx.google.com with ESMTPSA id qg7sm61073507bkb.6.2013.11.28.13.45.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 28 Nov 2013 13:45:36 -0800 (PST) In-Reply-To: <87txeww82d.fsf@topper.koldfront.dk> ("Adam \=\?utf-8\?Q\?Sj\?\= \=\?utf-8\?Q\?\=C3\=B8gren\=22's\?\= message of "Thu, 28 Nov 2013 22:05:46 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -3.0 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83934 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Nov 28 2013, Adam Sj=C3=B8gren wrote: > Jan Tatarik writes: >> the first patch [...] >> The second patch [...] > Regardless of what order I apply them in, I always get a conflict in > gnus-icalendar.el when handling the last patch. > Could you perhaps make the patches so they don't collide? > Maybe I'm just dense when applying them... Sorry, haven't tried myself before submitting them. Here you go, all in one. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=opt_reply.patch diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el index 56c56f3dd466975da7b23edd257058ff63fb8bfd..5f152921b663850918be8bfcb3a76f5e69bc1d6d 100644 --- a/lisp/gnus-icalendar.el +++ b/lisp/gnus-icalendar.el @@ -92,10 +92,10 @@ :accessor gnus-icalendar-event:rsvp :initform nil :type (or null boolean)) - (participation-required :initarg :participation-required - :accessor gnus-icalendar-event:participation-required - :initform t - :type (or null boolean)) + (participation-type :initarg :participation-type + :accessor gnus-icalendar-event:participation-type + :initform 'non-participant + :type (or null t)) (req-participants :initarg :req-participants :accessor gnus-icalendar-event:req-participants :initform nil @@ -196,15 +196,18 @@ (attendee (when attendee-name-or-email (gnus-icalendar-event--find-attendee ical attendee-name-or-email))) (attendee-names (gnus-icalendar-event--get-attendee-names ical)) + (role (plist-get (cadr attendee) 'ROLE)) + (participation-type (pcase role + ("REQ-PARTICIPANT" 'required) + ("OPT-PARTICIPANT" 'optional) + (_ 'non-participant))) (args (list :method method :organizer organizer :start-time (gnus-icalendar-event--decode-datefield event 'DTSTART) :end-time (gnus-icalendar-event--decode-datefield event 'DTEND) - :rsvp (string= (plist-get (cadr attendee) 'RSVP) - "TRUE") - :participation-required (string= (plist-get (cadr attendee) 'ROLE) - "REQ-PARTICIPANT") - :req-participants (cdar attendee-names) + :rsvp (string= (plist-get (cadr attendee) 'RSVP) "TRUE") + :participation-type participation-type + :req-participants (car attendee-names) :opt-participants (cadr attendee-names))) (event-class (cond ((string= method "REQUEST") 'gnus-icalendar-event-request) @@ -451,7 +454,7 @@ Return nil for non-recurring EVENT." ("DT" . ,(gnus-icalendar-event:org-timestamp event)) ("ORGANIZER" . ,(gnus-icalendar-event:organizer event)) ("LOCATION" . ,(gnus-icalendar-event:location event)) - ("PARTICIPATION_REQUIRED" . ,(when (gnus-icalendar-event:participation-required event) "t")) + ("PARTICIPATION_TYPE" . ,(symbol-name (gnus-icalendar-event:participation-type event))) ("REQ_PARTICIPANTS" . ,(gnus-icalendar--format-participant-list (gnus-icalendar-event:req-participants event))) ("OPT_PARTICIPANTS" . ,(gnus-icalendar--format-participant-list (gnus-icalendar-event:opt-participants event))) ("RRULE" . ,(gnus-icalendar-event:recur event)) @@ -513,7 +516,7 @@ is searched." (when file (with-current-buffer (find-file-noselect file) (with-slots (uid summary description organizer location recur - participation-required req-participants opt-participants) event + participation-type req-participants opt-participants) event (let ((event-pos (org-find-entry-with-id uid))) (when event-pos (goto-char event-pos) @@ -555,7 +558,7 @@ is searched." (org-entry-put event-pos "DT" (gnus-icalendar-event:org-timestamp event)) (org-entry-put event-pos "ORGANIZER" organizer) (org-entry-put event-pos "LOCATION" location) - (org-entry-put event-pos "PARTICIPATION_REQUIRED" (when participation-required "t")) + (org-entry-put event-pos "PARTICIPATION_TYPE" (symbol-name participation-type)) (org-entry-put event-pos "REQ_PARTICIPANTS" (gnus-icalendar--format-participant-list req-participants)) (org-entry-put event-pos "OPT_PARTICIPANTS" (gnus-icalendar--format-participant-list opt-participants)) (org-entry-put event-pos "RRULE" recur) @@ -691,12 +694,14 @@ only makes sense to define names or email addresses." (cadr x)))) (with-slots (organizer summary description location recur uid - method rsvp participation-required) event + method rsvp participation-type) event (let ((headers `(("Summary" ,summary) ("Location" ,(or location "")) ("Time" ,(gnus-icalendar-event:org-timestamp event)) ("Organizer" ,organizer) - ("Attendance" ,(if participation-required "Required" "Optional")) + ("Attendance" ,(if (eq participation-type 'non-participant) + "You are not listed as an attendee" + (capitalize (symbol-name participation-type)))) ("Method" ,method)))) (when (and (not (gnus-icalendar-event-reply-p event)) rsvp) --=-=-= Content-Type: text/plain The Changelog entry: 2013-11-25 Jan Tatarik * gnus-icalendar.el (gnus-icalendar-event-from-ical) (gnus-icalendar-event->org-entry) (gnus-icalendar--update-org-event) (gnus-icalendar-event->gnus-calendar): Distinguish between required/optional/non-participant attendee status. Fix bug causing the first required event participant to be omitted. --=-=-=--