From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83878 Path: news.gmane.org!not-for-mail From: Jan Tatarik Newsgroups: gmane.emacs.gnus.general Subject: PATCH: gnus-icalendar can update org entry for canceled appointments Date: Wed, 13 Nov 2013 17:02:50 +0100 Message-ID: <87wqkcl26t.fsf@nb-jtatarik2.xing.hh> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1384358632 20956 80.91.229.3 (13 Nov 2013 16:03:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Nov 2013 16:03:52 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32134@lists.math.uh.edu Wed Nov 13 17:03:52 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 1Vgcv1-0005Ie-GJ for ding-account@gmane.org; Wed, 13 Nov 2013 17:03:51 +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 1VgcuL-0007q9-Tg; Wed, 13 Nov 2013 10:03:09 -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 1VgcuK-0007q0-B7 for ding@lists.math.uh.edu; Wed, 13 Nov 2013 10:03:08 -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 1VgcuI-0002JR-LG for ding@lists.math.uh.edu; Wed, 13 Nov 2013 10:03:07 -0600 Original-Received: from mail-ee0-f47.google.com ([74.125.83.47]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1VgcuG-00034d-U0 for ding@gnus.org; Wed, 13 Nov 2013 17:03:05 +0100 Original-Received: by mail-ee0-f47.google.com with SMTP id c13so305304eek.20 for ; Wed, 13 Nov 2013 08:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=G/YLkerjobG185LCnUhMauw5HNvp3MAbVUKZca0r1KM=; b=ZuN0IQmxcxgDPNIneiUhUrc2SOupTZXymJmUsz+mcRbuZ8doiVP4Kvg2c4BfHHxrPy LQEzrjYNgaFsOAKhRShxYVeacL2UjQjKBgSRgfJNVgHxU7lCYppENu5uJV67VjEKoiYI 6ZLnqvH1pV7J7o2tU0qjoIQqCzpTflzl/YibW6KDITidjzFVJQ4G6vf/49QanNSko2Zb ElLQFLsrUXPrOYLdIy6ky8rIB7luXXSZR9kN8TWRMvW+HEEb0lbairQzHXMt1UcXPirI 7F9VSntpfbqBsBjDumKUdGV6NTn9FLxKpe5PgOKDO5Af/ZVfLG3pkn7wFHz8QR3/Oesh vpGQ== X-Received: by 10.15.24.68 with SMTP id i44mr1174006eeu.87.1384358579483; Wed, 13 Nov 2013 08:02:59 -0800 (PST) Original-Received: from nb-jtatarik2.xing.hh (office.xing.com. [82.112.107.65]) by mx.google.com with ESMTPSA id b42sm89449138eem.9.2013.11.13.08.02.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 13 Nov 2013 08:02:52 -0800 (PST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -2.2 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83878 Archived-At: --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=cancellation_sync.patch 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 + + * 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 * 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))) --=-=-=--