From 35c3fa10c6b12eaaf215725285dcee4d853ba577 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Mon, 5 Dec 2022 15:08:04 -0500 Subject: [PATCH] [to-rework] Extend meeting capture function The function now also parses non-zoom meetings --- global.org | 58 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/global.org b/global.org index e7b5016..8125e99 100644 --- a/global.org +++ b/global.org @@ -675,31 +675,49 @@ (buffer-substring-no-properties p q))) (defun format-zoom-meeting () - (concat zoom-summary - " [[" zoom-link "][link]] (" zoom-passcode "\n :SCHEDULED: " zoom-scheduled-time)) - + (if (boundp 'zoom-link) + (concat zoom-summary + " [[" zoom-link "][link]] (" zoom-passcode "\n SCHEDULED: " zoom-scheduled-time) + (concat zoom-summary "\n SCHEDULED: " zoom-scheduled-time))) (defun create-item-for-meeting (msg) "Search for messages sent by the sender of the message at point." + (makunbound 'zoom-link) + (makunbound 'zoom-passcode) (save-excursion (beginning-of-buffer) - (when (search-forward "Join Zoom Meeting") - (message "found zoom meeting") - (right-char) - (setq zoom-link (get-buffer-current-line)) - (when (search-forward "Passcode:") - (setq zoom-passcode (get-buffer-current-line))) - (search-backward "Time:") - (search-forward "<") - (left-char) - (setq zoom-scheduled-time (get-buffer-to-eol)) - (search-backward "Summary:") - (right-word) - (right-word) - (left-word) - (setq zoom-summary (get-buffer-to-eol)) - (org-capture nil "z")))) - + (cond ((search-forward "Join Zoom Meeting" nil t) + (message "found zoom meeting") + (right-char) + (setq zoom-link (get-buffer-current-line)) + (when (search-forward "Passcode:") + (setq zoom-passcode (get-buffer-current-line))) + (search-backward "Time:") + (search-forward "<") + (left-char) + (setq zoom-scheduled-time (get-buffer-to-eol)) + (search-backward "Summary:") + (right-word) + (right-word) + (left-word) + (setq zoom-summary (get-buffer-to-eol)) + (org-capture nil "z")) + ((search-forward "[ Accept ]") + (message "found generic meeting") + (search-forward "Summary:") + (right-word) + (right-word) + (left-word) + (setq zoom-summary (get-buffer-to-eol)) + (search-forward "Location:") + (right-word) + (left-word) + (setq zoom-summary (concat zoom-summary " @" (get-buffer-to-eol))) + (search-forward "Time:") + (search-forward "<") + (left-char) + (setq zoom-scheduled-time (get-buffer-to-eol)) + (org-capture nil "z"))))) ;; define 'z' as the shortcut