emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115092: lisp/gnus/gnus-icalendar.el: Fix for gnus-i


From: Katsumi Yamaoka
Subject: [Emacs-diffs] trunk r115092: lisp/gnus/gnus-icalendar.el: Fix for gnus-icalendar handling of empty appt locations; gnus-icalendar can update org entry for canceled appointments
Date: Wed, 13 Nov 2013 22:16:47 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115092
revision-id: address@hidden
parent: address@hidden
author: Jan Tatarik <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Wed 2013-11-13 22:16:42 +0000
message:
  lisp/gnus/gnus-icalendar.el: Fix for gnus-icalendar handling of empty appt 
locations; gnus-icalendar can update org entry for canceled appointments
modified:
  lisp/gnus/ChangeLog            changelog-20091113204419-o5vbwnq5f7feedwu-1433
  lisp/gnus/gnus-icalendar.el    
gnusicalendar.el-20130801225830-k3bdrwt8427ren1n-1
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2013-11-12 22:16:09 +0000
+++ b/lisp/gnus/ChangeLog       2013-11-13 22:16:42 +0000
@@ -1,3 +1,17 @@
+2013-11-13  Jan Tatarik  <address@hidden>
+
+       * 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  <address@hidden>
+
+       * 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  <address@hidden>
 
        * gnus-icalendar.el (gnus-icalendar-event-from-ical):

=== modified file 'lisp/gnus/gnus-icalendar.el'
--- a/lisp/gnus/gnus-icalendar.el       2013-11-12 22:16:09 +0000
+++ b/lisp/gnus/gnus-icalendar.el       2013-11-13 22:16:42 +0000
@@ -361,6 +361,11 @@
         (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 @@
                       ("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 @@
                        (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))
@@ -540,7 +546,7 @@
       (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)))
 
@@ -591,7 +597,7 @@
 
     (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))))
@@ -717,6 +723,18 @@
                (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)))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]