Gnus development mailing list
 help / color / mirror / Atom feed
* PATCH: gnus-icalendar can update org entry for canceled appointments
@ 2013-11-13 16:02 Jan Tatarik
  0 siblings, 0 replies; only message in thread
From: Jan Tatarik @ 2013-11-13 16:02 UTC (permalink / raw)
  To: ding

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

Hi,

the enclosed patch fixes a minor issue in gnus-icalendar.

The current version does not allow CANCEL events to be synced to
org. This makes sense if the original event being canceled has no org
entry. But if the user synced to original event to org, it will keep
showing in his agenda even after it has been canceled.

With this patch it is possible to update (=deactivate the org timestamp)
of org appointments for which a CANCEL event is received.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cancellation_sync.patch --]
[-- Type: text/x-diff, Size: 2013 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 88d6d894b41e27b511796e2ba91854cf6bf74997..fb7afd5c441b8517f0f29003baee2dbe7c0436c0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-13  Jan Tatarik  <jan.tatarik@gmail.com>
+
+	* gnus-icalendar.el (gnus-icalendar-event:sync-to-org)
+	(gnus-icalendar-event:inline-org-buttons): Allow for appointment
+	cancellations to be synced to org if the original appt has an org
+	outline.
+
 2013-11-12  Jan Tatarik  <jan.tatarik@gmail.com>
 
 	* gnus-icalendar.el (gnus-icalendar-event-from-ical):
diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index f3b62381b47e79b7f260d5ad8c46ad498096c7d9..0437917eea10481405dac6ac3f6dd3c140db5a43 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -540,7 +540,7 @@ is searched."
       (gnus-icalendar--update-org-event event reply-status)
     (gnus-icalendar:org-event-save event reply-status)))
 
-(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-cancel))
+(defmethod gnus-icalendar-event:sync-to-org ((event gnus-icalendar-event-cancel) reply-status)
   (when (gnus-icalendar-find-org-event-file event)
     (gnus-icalendar--cancel-org-event event)))
 
@@ -717,6 +717,18 @@ is searched."
                (when org-entry-exists-p
                  `("Show Org Entry" gnus-icalendar--show-org-event ,event))))))
 
+
+(defmethod gnus-icalendar-event:inline-org-buttons ((event gnus-icalendar-event-cancel))
+  (let ((org-entry-exists-p (gnus-icalendar-find-org-event-file event)))
+
+    (delq nil (list
+               `("Show Agenda" gnus-icalendar-show-org-agenda ,event)
+               (when org-entry-exists-p
+                 `("Update Org Entry" gnus-icalendar-sync-event-to-org ,event))
+               (when org-entry-exists-p
+                 `("Show Org Entry" gnus-icalendar--show-org-event ,event))))))
+
+
 (defun gnus-icalendar-mm-inline (handle)
   (let ((event (gnus-icalendar-event-from-handle handle gnus-icalendar-identities)))
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-13 16:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 16:02 PATCH: gnus-icalendar can update org entry for canceled appointments Jan Tatarik

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 NNTP newsgroup(s).