[to-rework] Extend meeting capture function

The function now also parses non-zoom meetings
master
Jacopo De Simoi 4 years ago
parent 40d3366d16
commit 35c3fa10c6
  1. 58
      global.org

@ -675,31 +675,49 @@
(buffer-substring-no-properties p q))) (buffer-substring-no-properties p q)))
(defun format-zoom-meeting () (defun format-zoom-meeting ()
(concat zoom-summary (if (boundp 'zoom-link)
" [[" zoom-link "][link]] (" zoom-passcode "\n :SCHEDULED: " zoom-scheduled-time)) (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) (defun create-item-for-meeting (msg)
"Search for messages sent by the sender of the message at point." "Search for messages sent by the sender of the message at point."
(makunbound 'zoom-link)
(makunbound 'zoom-passcode)
(save-excursion (save-excursion
(beginning-of-buffer) (beginning-of-buffer)
(when (search-forward "Join Zoom Meeting") (cond ((search-forward "Join Zoom Meeting" nil t)
(message "found zoom meeting") (message "found zoom meeting")
(right-char) (right-char)
(setq zoom-link (get-buffer-current-line)) (setq zoom-link (get-buffer-current-line))
(when (search-forward "Passcode:") (when (search-forward "Passcode:")
(setq zoom-passcode (get-buffer-current-line))) (setq zoom-passcode (get-buffer-current-line)))
(search-backward "Time:") (search-backward "Time:")
(search-forward "<") (search-forward "<")
(left-char) (left-char)
(setq zoom-scheduled-time (get-buffer-to-eol)) (setq zoom-scheduled-time (get-buffer-to-eol))
(search-backward "Summary:") (search-backward "Summary:")
(right-word) (right-word)
(right-word) (right-word)
(left-word) (left-word)
(setq zoom-summary (get-buffer-to-eol)) (setq zoom-summary (get-buffer-to-eol))
(org-capture nil "z")))) (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 ;; define 'z' as the shortcut

Loading…
Cancel
Save