[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/excorporate 0080f33 62/93: Excorporate: Add item identi
From: |
Stefan Monnier |
Subject: |
[elpa] externals/excorporate 0080f33 62/93: Excorporate: Add item identifiers to Org buffer |
Date: |
Sun, 29 Nov 2020 15:43:09 -0500 (EST) |
branch: externals/excorporate
commit 0080f338423d1178c3601e56c8eba7d7bfbf8c7b
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Excorporate: Add item identifiers to Org buffer
* packages/excorporate/excorporate-org.el
(exco-org-insert-meeting-headline): Add item identifier argument
and set Org property to it.
(exco-org-insert-meeting): Add item identifier argument.
(exco-org-insert-meetings): Call
exco-calendar-item-iterate-general to be called back with
item-identifier argument.
(exco-org-finalize-buffer): Close all PROPERTIES drawers.
---
excorporate-org.el | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/excorporate-org.el b/excorporate-org.el
index b8a5a12..8f9cec4 100644
--- a/excorporate-org.el
+++ b/excorporate-org.el
@@ -58,11 +58,16 @@
"Format an Org headline using IDENTIFIER."
(format "* Calendar (%S)\n" identifier))
-(defun exco-org-insert-meeting-headline (subject start-time end-time)
+(defun exco-org-insert-meeting-headline (subject
+ start-time end-time
+ &optional item-identifier)
"Insert and schedule a meeting.
SUBJECT is the meeting's subject, START-TIME and END-TIME are the
meeting's start and end times in the same format as is returned
-by `current-time'."
+by `current-time'. ITEM-IDENTIFIER is the item identifier in the
+form:
+
+(ItemId (Id . ID-STRING) (ChangeKey . CHANGEKEY-STRING))"
(let* ((now (current-time))
(keyword (if (time-less-p now end-time)
"TODO"
@@ -74,6 +79,7 @@ by `current-time'."
(end-of-line)
(insert "--" (format-time-string "<%Y-%m-%d %a %H:%M>" end-time))
(forward-line)
+ (org-set-property "Identifier" (format "%S" item-identifier))
(org-insert-time-stamp (current-time) t t "+ Retrieved " "\n")))
(defun exco-org-insert-invitees (invitees)
@@ -98,14 +104,17 @@ by `current-time'."
nil t " + Date " "\n")))))
(defun exco-org-insert-meeting (subject start end location
- main-invitees optional-invitees)
+ main-invitees optional-invitees
+ &optional item-identifier)
"Insert a scheduled meeting.
SUBJECT is a string, the subject of the meeting. START is the
meeting start time in Emacs internal date time format, and END is
the end of the meeting in the same format. LOCATION is a string
representing the location. MAIN-INVITEES and OPTIONAL-INVITEES
-are the requested participants."
- (exco-org-insert-meeting-headline subject start end)
+are the requested participants. ITEM-IDENTIFIER, a pair of
+strings represending the item identifier and the change
+identifier for that item."
+ (exco-org-insert-meeting-headline subject start end item-identifier)
(insert (format "+ Duration: %d minutes\n"
(round (/ (float-time (time-subtract end start)) 60.0))))
(insert (format "+ Location: %s\n" location))
@@ -126,11 +135,13 @@ are the requested participants."
(with-current-buffer (exco-org--identifier-buffer identifier)
(let ((inhibit-read-only t))
(org-insert-time-stamp (current-time) t t " + Last checked " "\n")
- (exco-calendar-item-iterate
+ (exco-calendar-item-iterate-general
response (lambda (&rest arguments)
(with-current-buffer (exco-org--identifier-buffer identifier)
(org-mode)
- (apply #'exco-org-insert-meeting arguments))))
+ (apply #'exco-org-insert-meeting arguments)))
+ subject start-internal end-internal
+ location main-invitees optional-invitees item-identifier)
(goto-char (point-min))
(if (save-excursion (org-goto-first-child))
(org-sort-entries t ?s)
@@ -147,6 +158,7 @@ are the requested participants."
(insert "done.\n")
(dolist (result-buffer (nreverse exco-org--temporary-buffers))
(insert-buffer-substring result-buffer)
+ (save-excursion (org-up-heading-safe) (org-cycle-hide-drawers 'all))
(kill-buffer result-buffer))
(setq exco-org--temporary-buffers '()))))
- [elpa] externals/excorporate 23e514f 33/93: packages/excorporate: Mention appt features in documentation, (continued)
- [elpa] externals/excorporate 23e514f 33/93: packages/excorporate: Mention appt features in documentation, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate e788f73 38/93: Advise icalendar--add-diary-entry conditionally, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate eb2430f 34/93: packages/excorporate: Bump version to 0.8.0, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate a8ba2d4 30/93: packages/excorporate: Add diary and appt integration, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 2e13256 49/93: excorporate-diary: Don't force diary-fancy-display, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 556433b 54/93: excorporate: Bump required package versions, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate ba927b9 52/93: packages/excorporate: Update HTTP debugging steps, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate b37aecf 51/93: excorporate-diary: Fix percent signs in appt, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 00ef8e7 55/93: excorporate: Update HTTPS proxy and GSSAPI status in manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate fac0fee 56/93: packages/excorporate/excorporate.el: Add an acknowledgment, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 0080f33 62/93: Excorporate: Add item identifiers to Org buffer,
Stefan Monnier <=
- [elpa] externals/excorporate b228664 69/93: Excorporate: Support replying to meeting requests, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate cee32a6 65/93: Excorporate: Add support for synchronous operations, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 166b417 72/93: Excorporate: Add an organizer resolver function, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 936eb4a 61/93: Excorporate: Change identifier format in Org buffer, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate d43e575 58/93: Excorporate: Add an item iteration macro, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 212c8bd 80/93: Excorporate: Rewrite exco-org functions for Org 9.1, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 24a625f 86/93: Excorporate: Add an operation arity function, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate 23d19b3 79/93: Excorporate: Document API usage in manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate bf88ded 83/93: Excorporate: Add more API usage examples to manual, Stefan Monnier, 2020/11/29
- [elpa] externals/excorporate c72216a 92/93: Excorporate: Bump version to 0.9.1, Stefan Monnier, 2020/11/29