[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/excorporate 30cc0bd 63/93: Excorporate: Add appointment
From: |
Stefan Monnier |
Subject: |
[elpa] externals/excorporate 30cc0bd 63/93: Excorporate: Add appointment deletion in Org buffer |
Date: |
Sun, 29 Nov 2020 15:43:10 -0500 (EST) |
branch: externals/excorporate
commit 30cc0bdccc1eb2ad8af09d23d9215540e1f54d19
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Excorporate: Add appointment deletion in Org buffer
* packages/excorporate/excorporate-org.el
(exco-org--connection-identifier-at-point): New function.
(exco-org-delete-appointment): Likewise.
---
excorporate-org.el | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/excorporate-org.el b/excorporate-org.el
index 8f9cec4..4fab6b3 100644
--- a/excorporate-org.el
+++ b/excorporate-org.el
@@ -33,6 +33,45 @@
(defvar exco-org--temporary-buffers '()
"A list of per-connection result buffers.")
+(defun exco-org--connection-identifier-at-point ()
+ "Return the connection identifier associated with point."
+ (let* ((calendar-headline
+ (save-excursion (org-up-heading-safe) (org-element-at-point)))
+ (headline (org-element-property :raw-value calendar-headline)))
+ (string-match "Calendar (\\(.*\\))$" headline)
+ (car (read-from-string (match-string 1 headline)))))
+
+(defun exco-org-delete-appointment ()
+ "Delete the appointment at point."
+ (interactive)
+ (let ((identifier (exco-org--connection-identifier-at-point))
+ (item-identifier
+ (org-entry-get (car (org-get-property-block)) "Identifier")))
+ (when item-identifier
+ (exco-calendar-item-appointment-delete
+ identifier
+ (car (read-from-string item-identifier))
+ (lambda (identifier response)
+ (let ((response-code
+ (exco-extract-value '(ResponseMessages
+ DeleteItemResponseMessage
+ ResponseCode)
+ response)))
+ (if (equal response-code "NoError")
+ (with-current-buffer (get-buffer-create
+ excorporate-org-buffer-name)
+ (save-excursion
+ (org-back-to-heading)
+ (let* ((inhibit-read-only t)
+ (element (org-element-at-point))
+ (begin (org-element-property :begin element))
+ (end (org-element-property :end element)))
+ (kill-region begin end)
+ (message
+ "excorporate-org: Successfully deleted appointment"))))
+ (message "excorporate-org: Failed to delete appointment: %S"
+ response-code))))))))
+
(defun exco-org-initialize-buffer ()
"Add initial text to the destination buffer."
(setq exco-org--temporary-buffers '())
- [elpa] externals/excorporate 5bd2608 59/93: Excorporate: Support appointment deletion, (continued)
- [elpa] externals/excorporate 5bd2608 59/93: Excorporate: Support appointment deletion, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 064e34d 57/93: packages/excorporate/excorporate.el: Adjust case in example URL, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 6487138 70/93: Excorporate: Adjust some documentation strings, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate da3898b 85/93: Excorporate: Rename a function, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 96a76cd 90/93: Excorporate: Adjust some URLs in the manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 47d2698 32/93: packages/excorporate: Support diary on Emacs 24.1, 24.2, 24.3, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 77030b3 37/93: packages/excorporate: Fix generated whitespace issue, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 7849d8f 42/93: excorporate-diary: Add feature idea comment, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate f3888e1 77/93: Excorporate: Require Org 9.0 or newer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 2f76f57 71/93: Excorporate: Change organizer representation, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 30cc0bd 63/93: Excorporate: Add appointment deletion in Org buffer,
Stefan Monnier <=
- [elpa] externals/excorporate 538e908 68/93: Excorporate: Support cancelling meetings in Org buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 8e7779a 81/93: Excorporate: Expand responses in API usage examples, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 5f81163 88/93: Excorporate: Fix a byte-compilation warning, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 34827cc 06/93: packages/excorporate: Retrieve Services.wsdl directly, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate da2b980 08/93: packages/excorporate: Improve exco-get-meetings-for-day, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate da594da 14/93: packages/excorporate: Bump version to 0.7.3, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 68c5585 17/93: packages/excorporate: Interoperate with `save-some-buffers', Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 52d6067 21/93: excorporate.el: Bump version to 0.7.6, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 7e855f7 23/93: excorporate.el: Bump soap-client requirement to 3.1.4, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate a588ff6 27/93: packages/excorporate: Bump version to 0.7.7, Stefan Monnier, 2020/11/29