aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tatarik2013-08-06 22:09:27 +0000
committerKatsumi Yamaoka2013-08-06 22:09:27 +0000
commitec9564383ba1599be3e253d0b6643d392938de41 (patch)
tree5198148016935e6f71f3abb4f9759327fe267b30
parent2122cb6dd2e1323963ebb2340078fc9f22e245e7 (diff)
downloademacs-ec9564383ba1599be3e253d0b6643d392938de41.tar.gz
emacs-ec9564383ba1599be3e253d0b6643d392938de41.zip
gnus-icalendar.el (gnus-icalendar-event-from-ical): Replace pcase with cond for backwards compatability
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-icalendar.el30
2 files changed, 21 insertions, 14 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 238017e25fc..96187c48844 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12013-08-06 Jan Tatarik <jan.tatarik@gmail.com>
2
3 * gnus-icalendar.el (gnus-icalendar-event-from-ical): Replace pcase
4 with cond for backwards compatability.
5
12013-08-06 Katsumi Yamaoka <yamaoka@jpl.org> 62013-08-06 Katsumi Yamaoka <yamaoka@jpl.org>
2 7
3 * mm-decode.el (mm-display-external): Bind process-connection-type to 8 * mm-decode.el (mm-display-external): Bind process-connection-type to
diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 0286fd5dd89..3a9e743e8ed 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -183,11 +183,11 @@
183 :end (gnus-icalendar-event--decode-datefield event 'DTEND zone-map) 183 :end (gnus-icalendar-event--decode-datefield event 'DTEND zone-map)
184 :rsvp (string= (plist-get (cadr attendee) 'RSVP) 184 :rsvp (string= (plist-get (cadr attendee) 'RSVP)
185 "TRUE"))) 185 "TRUE")))
186 (event-class (pcase method 186 (event-class (cond
187 ("REQUEST" 'gnus-icalendar-event-request) 187 ((string= method "REQUEST") 'gnus-icalendar-event-request)
188 ("CANCEL" 'gnus-icalendar-event-cancel) 188 ((string= method "CANCEL") 'gnus-icalendar-event-cancel)
189 ("REPLY" 'gnus-icalendar-event-reply) 189 ((string= method "REPLY") 'gnus-icalendar-event-reply)
190 (_ 'gnus-icalendar-event)))) 190 (t 'gnus-icalendar-event))))
191 191
192 (labels ((map-property (prop) 192 (labels ((map-property (prop)
193 (let ((value (icalendar--get-event-property event prop))) 193 (let ((value (icalendar--get-event-property event prop)))
@@ -252,14 +252,15 @@ status will be retrieved from the first matching attendee record."
252 ;; NOTE: not all of the below fields are mandatory, 252 ;; NOTE: not all of the below fields are mandatory,
253 ;; but they are often present in other clients' 253 ;; but they are often present in other clients'
254 ;; replies. Can be helpful for debugging, too. 254 ;; replies. Can be helpful for debugging, too.
255 (new-line (pcase key 255 (new-line
256 ("ATTENDEE" (update-attendee-status line)) 256 (cond
257 ("SUMMARY" (update-summary line)) 257 ((string= key "ATTENDEE") (update-attendee-status line))
258 ("DTSTAMP" (update-dtstamp)) 258 ((string= key "SUMMARY") (update-summary line))
259 ((or "ORGANIZER" "DTSTART" "DTEND" 259 ((string= key "DTSTAMP") (update-dtstamp))
260 "LOCATION" "DURATION" "SEQUENCE" 260 ((find key '("ORGANIZER" "DTSTART" "DTEND"
261 "RECURRENCE-ID" "UID") line) 261 "LOCATION" "DURATION" "SEQUENCE"
262 (_ nil)))) 262 "RECURRENCE-ID" "UID")) line)
263 (t nil))))
263 (when new-line 264 (when new-line
264 (push new-line reply-event-lines)))))) 265 (push new-line reply-event-lines))))))
265 266
@@ -405,7 +406,8 @@ Return nil for non-recurring EVENT."
405 406
406(defun gnus-icalendar--deactivate-org-timestamp (ts) 407(defun gnus-icalendar--deactivate-org-timestamp (ts)
407 (replace-regexp-in-string "[<>]" 408 (replace-regexp-in-string "[<>]"
408 (lambda (m) (pcase m ("<" "[") (">" "]"))) 409 (lambda (m) (cond ((string= m "<") "[")
410 ((string= m ">") "]")))
409 ts)) 411 ts))
410 412
411(defun gnus-icalendar-find-org-event-file (event &optional org-file) 413(defun gnus-icalendar-find-org-event-file (event &optional org-file)