[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 42d696c 01/11: Excorporate: Add an item iteration macro
From: |
Thomas Fitzsimmons |
Subject: |
[elpa] master 42d696c 01/11: Excorporate: Add an item iteration macro |
Date: |
Wed, 23 Sep 2020 21:50:08 -0400 (EDT) |
branch: master
commit 42d696ccedbb946a03562c716cafbc21b6741ee3
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Excorporate: Add an item iteration macro
* packages/excorporate/excorporate.el
(exco-calendar-item-iterate-general): New macro.
(exco-calendar-item-iterate): Call
exco-calendar-item-iterate-general.
---
packages/excorporate/excorporate.el | 52 +++++++++++++++++++++++++------------
1 file changed, 36 insertions(+), 16 deletions(-)
diff --git a/packages/excorporate/excorporate.el
b/packages/excorporate/excorporate.el
index 271f2cc..694be81 100644
--- a/packages/excorporate/excorporate.el
+++ b/packages/excorporate/excorporate.el
@@ -756,28 +756,48 @@ processing is done."
location main-invitees optional-invitees
icalendar-text)))))))
+(defmacro exco-calendar-item-iterate-general (response
+ callback &rest care-abouts)
+ "Iterate through calendar items in RESPONSE, calling CALLBACK on each.
+Return a list of results from callback. CARE-ABOUTS is a list of
+symbols representing the arguments with which CALLBACK should be
+called. Options are:
+SUBJECT, a string, the subject of the meeting.
+START, the start date and time in Emacs internal representation.
+END, the start date and time in Emacs internal representation.
+LOCATION, the location of the meeting.
+MAIN-INVITEES, a list of strings, email addresses of the required
+participants.
+OPTIONAL-INVITEES, a list of strings, email addresses of optional
+participants.
+ITEM-IDENTIFIER, a structure of the form (ItemId (Id
+. ID-STRING) (ChangeKey . CHANGEKEY-STRING))."
+ `(let ((result-list '()))
+ (exco--calendar-item-dolist
+ calendar-item (exco-extract-value '(ResponseMessages
+ FindItemResponseMessage
+ RootFolder
+ Items)
+ ,response)
+ (push (funcall ,callback ,@care-abouts)
+ result-list))
+ (nreverse result-list)))
+
(defun exco-calendar-item-iterate (response callback)
"Iterate through calendar items in RESPONSE, calling CALLBACK on each.
-Returns a list of results from callback. CALLBACK takes arguments:
+Return a list of results from callback. CALLBACK takes arguments:
SUBJECT, a string, the subject of the meeting.
START, the start date and time in Emacs internal representation.
END, the start date and time in Emacs internal representation.
LOCATION, the location of the meeting.
-MAIN-INVITEES, a list of strings representing required participants.
-OPTIONAL-INVITEES, a list of strings representing optional participants."
- (let ((result-list '()))
- (exco--calendar-item-dolist
- calendar-item (exco-extract-value '(ResponseMessages
- FindItemResponseMessage
- RootFolder
- Items)
- response)
- ;; Silence byte compiler unused warning.
- item-identifier
- (push (funcall callback subject start-internal end-internal
- location main-invitees optional-invitees)
- result-list))
- (nreverse result-list)))
+MAIN-INVITEES, a list of strings, email addresses of the required
+participants.
+OPTIONAL-INVITEES, a list of strings, email addresses of optional
+participants."
+ (exco-calendar-item-iterate-general
+ response callback
+ subject start-internal end-internal
+ location main-invitees optional-invitees))
;; Date-time utility functions.
(defun exco-extend-timezone (date-time-string)
- [elpa] master updated (3e43a84 -> fdfd986), Thomas Fitzsimmons, 2020/09/23
- [elpa] master 784e3fe 02/11: Excorporate: Support appointment deletion, Thomas Fitzsimmons, 2020/09/23
- [elpa] master 1435365 06/11: Excorporate: Add appointment deletion in Org buffer, Thomas Fitzsimmons, 2020/09/23
- [elpa] master ea318ec 07/11: Excorporate: Support appointment creation, Thomas Fitzsimmons, 2020/09/23
- [elpa] master 42d696c 01/11: Excorporate: Add an item iteration macro,
Thomas Fitzsimmons <=
- [elpa] master b3e2449 03/11: Excorporate: Avoid trailing newline in Org buffer, Thomas Fitzsimmons, 2020/09/23
- [elpa] master 08ff756 04/11: Excorporate: Change identifier format in Org buffer, Thomas Fitzsimmons, 2020/09/23
- [elpa] master 5ea2897 05/11: Excorporate: Add item identifiers to Org buffer, Thomas Fitzsimmons, 2020/09/23
- [elpa] master 7ba2f5c 08/11: Excorporate: Add support for synchronous operations, Thomas Fitzsimmons, 2020/09/23
- [elpa] master a9e135d 09/11: Excorporate: Provide organizer to iterators, Thomas Fitzsimmons, 2020/09/23
- [elpa] master 027a95b 10/11: Excorporate: Support creating and cancelling meetings, Thomas Fitzsimmons, 2020/09/23
- [elpa] master fdfd986 11/11: Excorporate: Support cancelling meetings in Org buffer, Thomas Fitzsimmons, 2020/09/23