[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 3bd310b 07/11: Excorporate: Support replying to meeting re
From: |
Thomas Fitzsimmons |
Subject: |
[elpa] master 3bd310b 07/11: Excorporate: Support replying to meeting requests in Org buffer |
Date: |
Thu, 24 Sep 2020 21:54:53 -0400 (EDT) |
branch: master
commit 3bd310b0adc6a47f7974c23decd4d93d8c2ae659
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Excorporate: Support replying to meeting requests in Org buffer
* packages/excorporate/excorporate-org.el
(exco-org--reply-to-meeting): New function.
(exco-org-accept-meeting-request): Likewise.
(exco-org-decline-meeting-request): Likewise.
(exco-org-tentatively-accept-meeting-request): Likewise.
---
packages/excorporate/excorporate-org.el | 51 +++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/packages/excorporate/excorporate-org.el
b/packages/excorporate/excorporate-org.el
index a03ebff..f6edc05 100644
--- a/packages/excorporate/excorporate-org.el
+++ b/packages/excorporate/excorporate-org.el
@@ -110,6 +110,57 @@ operated on."
(begin (org-element-property :begin element))
(end (org-element-property :end element)))
(delete-region begin end)))))
+
+(defun exco-org--reply-to-meeting (acceptance prompt-for-message)
+ "Reply to a meeting.
+ACCEPTANCE is a symbol, one of `accept', `tentatively-accept', or
+`decline'. PROMPT-FOR-MESSAGE is non-nil to prompt the user for
+a message to include in the reply or nil to not include a
+message."
+ (let (prompt success failure)
+ (cl-ecase acceptance
+ (accept
+ (setq prompt "Acceptance message: ")
+ (setq success "accepted")
+ (setq failure "accept"))
+ (tentatively-accept
+ (setq prompt "Tentative acceptance message: ")
+ (setq success "accepted tentatively")
+ (setq failure "accept tentatively"))
+ (decline
+ (setq prompt "Declination message: ")
+ (setq success "declined")
+ (setq failure "decline")))
+ (let ((message (when prompt-for-message (read-from-minibuffer prompt)))
+ (identifier (exco-org--connection-identifier-at-point))
+ (item-identifier (exco-org--item-identifier-at-point)))
+ (exco-calendar-item-meeting-reply
+ identifier item-identifier message acceptance
+ (lambda (identifier response)
+ (exco-org--handle-response response CreateItemResponseMessage
+ success failure))))))
+
+(defun exco-org-accept-meeting-request (&optional argument)
+ "Accept the meeting at point.
+With a prefix argument, ARGUMENT, prompts for response message
+text."
+ (interactive "P")
+ (exco-org--reply-to-meeting 'accept argument))
+
+(defun exco-org-decline-meeting-request (&optional argument)
+ "Decline the meeting at point.
+With a prefix argument, ARGUMENT, prompts for response message
+text."
+ (interactive "P")
+ (exco-org--reply-to-meeting 'decline argument))
+
+(defun exco-org-tentatively-accept-meeting-request (&optional argument)
+ "Tentatively accept the meeting at point.
+With a prefix argument, ARGUMENT, prompts for response message
+text."
+ (interactive "P")
+ (exco-org--reply-to-meeting 'tentatively-accept argument))
+
(defun exco-org-cancel-meeting ()
"Cancel the meeting at point, prompting for a cancellation message."
(interactive)
- [elpa] master updated (fdfd986 -> 9ce646f), Thomas Fitzsimmons, 2020/09/24
- [elpa] master ba7b6c9 05/11: Excorporate: Add some helper functions to Org backend, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 9ce646f 11/11: Excorporate: Document API usage in manual, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 030ea89 02/11: Excorporate: Adjust some documentation strings, Thomas Fitzsimmons, 2020/09/24
- [elpa] master a078150 01/11: Excorporate: Support replying to meeting requests, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 05bd7d0 03/11: Excorporate: Change organizer representation, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 5281378 04/11: Excorporate: Add an organizer resolver function, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 5df7dfd 06/11: Excorporate: Simplify organizer handling in Org backend, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 3bd310b 07/11: Excorporate: Support replying to meeting requests in Org buffer,
Thomas Fitzsimmons <=
- [elpa] master 57020a8 08/11: Excorporate: Fix some byte compiler warnings, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 064a111 09/11: Excorporate: Require Org 9.0 or newer, Thomas Fitzsimmons, 2020/09/24
- [elpa] master 137f24e 10/11: Excorporate: Document new interactive functions, Thomas Fitzsimmons, 2020/09/24