[gnus git] branch master updated: m0-7-248-gacd40f7 =2= gnus-icalendar can update org entry for canceled appointments. ; Fix for gnus-icalendar handling of empty appt locations.

Adam Sj??gren <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  acd40f7487f8d1aaf063611fc9693729ef8cb9aa (commit)
       via  2afe41fe82a9c04be770fc05d60e58f1122aca99 (commit)
      from  be42855dd6c780a5402c4fd626687aecb7776a7c (commit)


- Log -----------------------------------------------------------------
commit acd40f7487f8d1aaf063611fc9693729ef8cb9aa
Author: Jan Tatarik <[email protected]>
Date:   Wed Nov 13 17:02:50 2013 +0100

    gnus-icalendar can update org entry for canceled appointments.
    
    * 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.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6e98f8f..45af3d8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
 2013-11-13  Jan Tatarik  <[email protected]>
 
+	* 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-13  Jan Tatarik  <[email protected]>
+
 	* gnus-icalendar.el (gnus-icalendar--format-summary-line)
 	(gnus-icalendar-event->org-entry)
 	(gnus-icalendar--update-org-event)
diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index cbb2855..064ba84 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -546,7 +546,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)))
 
@@ -723,6 +723,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)))
 

commit 2afe41fe82a9c04be770fc05d60e58f1122aca99
Author: Jan Tatarik <[email protected]>
Date:   Wed Nov 13 16:10:45 2013 +0100

    Fix for gnus-icalendar handling of empty appt locations.
    
    * gnus-icalendar.el (gnus-icalendar--format-summary-line)
    (gnus-icalendar-event->org-entry)
    (gnus-icalendar--update-org-event)
    (gnus-icalendar-event->gnus-calendar): Fix empty location handling.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 88d6d89..6e98f8f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2013-11-13  Jan Tatarik  <[email protected]>
+
+	* gnus-icalendar.el (gnus-icalendar--format-summary-line)
+	(gnus-icalendar-event->org-entry)
+	(gnus-icalendar--update-org-event)
+	(gnus-icalendar-event->gnus-calendar): Fix empty location handling.
+
 2013-11-12  Jan Tatarik  <[email protected]>
 
 	* gnus-icalendar.el (gnus-icalendar-event-from-ical):
diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index f3b6238..cbb2855 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -361,6 +361,11 @@ Return nil for non-recurring EVENT."
         (format "<%s %s-%s%s>" start-date start-time end-time repeat)
       (format "<%s %s>--<%s %s>" start-date start-time end-date end-time))))
 
+(defun gnus-icalendar--format-summary-line (summary &optional location)
+  (if location
+      (format "%s (%s)" summary location)
+    (format "%s" summary)))
+
 ;; TODO: make the template customizable
 (defmethod gnus-icalendar-event->org-entry ((event gnus-icalendar-event) reply-status)
   "Return string with new `org-mode' entry describing EVENT."
@@ -378,7 +383,8 @@ Return nil for non-recurring EVENT."
                       ("RRULE" . ,(gnus-icalendar-event:recur event))
                       ("REPLY" . ,reply))))
 
-        (insert (format "* %s (%s)\n\n" summary location))
+        (insert (format "* %s\n\n"
+                        (gnus-icalendar--format-summary-line summary location)))
         (mapc (lambda (prop)
                 (org-entry-put (point) (car prop) (cdr prop)))
               props))
@@ -443,7 +449,7 @@ is searched."
                        (headline (delq nil (list
                                             (org-entry-get (point) "TODO")
                                             (when priority (format "[#%s]" priority))
-                                            (format "%s (%s)" summary location)
+                                            (gnus-icalendar--format-summary-line summary location)
                                             (org-entry-get (point) "TAGS")))))
 
                   (re-search-forward "^\\*+ " (line-end-position))
@@ -591,7 +597,7 @@ is searched."
 
     (with-slots (organizer summary description location recur uid method rsvp) event
       (let ((headers `(("Summary" ,summary)
-                      ("Location" ,location)
+                      ("Location" ,(or location ""))
                       ("Time" ,(gnus-icalendar-event:org-timestamp event))
                       ("Organizer" ,organizer)
                       ("Method" ,method))))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog         |   14 ++++++++++++++
 lisp/gnus-icalendar.el |   26 ++++++++++++++++++++++----
 2 files changed, 36 insertions(+), 4 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.