|
|
|
|
@ -902,115 +902,117 @@ |
|
|
|
|
** mu4e |
|
|
|
|
These are some standard config items |
|
|
|
|
#+begin_src emacs-lisp |
|
|
|
|
(require 'smtpmail) |
|
|
|
|
(require 'mu4e) |
|
|
|
|
(require 'helm-mu) |
|
|
|
|
(global-set-key (kbd "C-x μ") 'mu4e) |
|
|
|
|
(global-set-key (kbd "C-x 5 μ") (eval-with-new-frame (mu4e))) |
|
|
|
|
|
|
|
|
|
(defalias 'μ 'mu4e) |
|
|
|
|
|
|
|
|
|
(setq mu4e-maildir "~/.mail" |
|
|
|
|
mu4e-attachment-dir "~/attachments" |
|
|
|
|
mu4e-html2text-command "w3m -dump -T text/html -cols 72 -o display_link_number=true -o auto_image=false -o display_image=false -o ignore_null_img_alt=true" |
|
|
|
|
mu4e-headers-show-threads nil |
|
|
|
|
mu4e-headers-sort-direction "descending" |
|
|
|
|
mail-user-agent 'mu4e-user-agent |
|
|
|
|
read-mail-command 'mu4e |
|
|
|
|
mu4e-update-interval 120 |
|
|
|
|
mu4e-view-use-gnus t |
|
|
|
|
message-kill-buffer-on-exit t |
|
|
|
|
mu4e-compose-format-flowed t |
|
|
|
|
fill-flowed-encode-column 998 |
|
|
|
|
mm-text-html-renderer 'gnus-w3m |
|
|
|
|
mu4e-read-option-use-builtin nil |
|
|
|
|
mu4e-completing-read-function 'completing-read |
|
|
|
|
mu4e-modeline-support nil |
|
|
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
(let (p1 p2 myLine) |
|
|
|
|
(setq p1 (line-beginning-position) ) |
|
|
|
|
(setq p2 (line-end-position) ) |
|
|
|
|
(setq myLine (buffer-substring-no-properties p1 p2))) |
|
|
|
|
|
|
|
|
|
(defun get-buffer-current-line () |
|
|
|
|
(let ((p (line-beginning-position)) |
|
|
|
|
(q (line-end-position))) |
|
|
|
|
(buffer-substring-no-properties p q))) |
|
|
|
|
|
|
|
|
|
(defun get-buffer-to-eol () |
|
|
|
|
(let ((p (point)) |
|
|
|
|
(q (line-end-position))) |
|
|
|
|
(buffer-substring-no-properties p q))) |
|
|
|
|
|
|
|
|
|
(defun format-zoom-meeting () |
|
|
|
|
(if (boundp 'zoom-link) |
|
|
|
|
(if (boundp 'zoom-passcode) |
|
|
|
|
(concat zoom-summary |
|
|
|
|
" [[" zoom-link "][link]] (" zoom-passcode ")\n SCHEDULED: " zoom-scheduled-time) |
|
|
|
|
(concat zoom-summary |
|
|
|
|
" [[" zoom-link "][link]]\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) |
|
|
|
|
(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:" nil t) |
|
|
|
|
(setq zoom-passcode (get-buffer-current-line))) |
|
|
|
|
(beginning-of-buffer) |
|
|
|
|
(search-forward "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 |
|
|
|
|
(add-to-list 'mu4e-view-actions |
|
|
|
|
'("zCreate agenda item for meeting" . create-item-for-meeting) t) |
|
|
|
|
(advice-add 'mu4e-update-mail-and-index :around |
|
|
|
|
(lambda (orig-fun &rest args) |
|
|
|
|
"Only trigger an update if the server is the one that should |
|
|
|
|
currently be active; otherwise each mu4e instance will trigger an |
|
|
|
|
update" |
|
|
|
|
(when (string-equal server-name (kde-current-activity-name)) |
|
|
|
|
(apply orig-fun args)))) |
|
|
|
|
(require 'smtpmail) |
|
|
|
|
(require 'mu4e) |
|
|
|
|
(require 'helm-mu) |
|
|
|
|
(global-set-key (kbd "C-x μ") 'mu4e) |
|
|
|
|
(global-set-key (kbd "C-x 5 μ") (eval-with-new-frame (mu4e))) |
|
|
|
|
|
|
|
|
|
(defalias 'μ 'mu4e) |
|
|
|
|
|
|
|
|
|
(setq mu4e-maildir "~/.mail" |
|
|
|
|
mu4e-attachment-dir "~/attachments" |
|
|
|
|
mu4e-html2text-command "w3m -dump -T text/html -cols 72 -o display_link_number=true -o auto_image=false -o display_image=false -o ignore_null_img_alt=true" |
|
|
|
|
mu4e-headers-show-threads nil |
|
|
|
|
mu4e-headers-sort-direction "descending" |
|
|
|
|
mail-user-agent 'mu4e-user-agent |
|
|
|
|
read-mail-command 'mu4e |
|
|
|
|
mu4e-update-interval 120 |
|
|
|
|
mu4e-view-use-gnus t |
|
|
|
|
message-kill-buffer-on-exit t |
|
|
|
|
mu4e-compose-format-flowed t |
|
|
|
|
fill-flowed-encode-column 998 |
|
|
|
|
mm-text-html-renderer 'gnus-w3m |
|
|
|
|
mu4e-read-option-use-builtin nil |
|
|
|
|
mu4e-completing-read-function 'completing-read |
|
|
|
|
mu4e-modeline-support nil |
|
|
|
|
|
|
|
|
|
(advice-add 'mu4e~header-line-format :around |
|
|
|
|
(lambda (orig-fun &rest args) |
|
|
|
|
(let ((mu4e-use-fancy-chars t) |
|
|
|
|
(mu4e--mark-fringe-len 5)) |
|
|
|
|
(apply orig-fun args)))) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
(let (p1 p2 myLine) |
|
|
|
|
(setq p1 (line-beginning-position) ) |
|
|
|
|
(setq p2 (line-end-position) ) |
|
|
|
|
(setq myLine (buffer-substring-no-properties p1 p2))) |
|
|
|
|
|
|
|
|
|
(defun get-buffer-current-line () |
|
|
|
|
(let ((p (line-beginning-position)) |
|
|
|
|
(q (line-end-position))) |
|
|
|
|
(buffer-substring-no-properties p q))) |
|
|
|
|
|
|
|
|
|
(defun get-buffer-to-eol () |
|
|
|
|
(let ((p (point)) |
|
|
|
|
(q (line-end-position))) |
|
|
|
|
(buffer-substring-no-properties p q))) |
|
|
|
|
|
|
|
|
|
(defun format-zoom-meeting () |
|
|
|
|
(if (boundp 'zoom-link) |
|
|
|
|
(if (boundp 'zoom-passcode) |
|
|
|
|
(concat zoom-summary |
|
|
|
|
" [[" zoom-link "][link]] (" zoom-passcode ")\n SCHEDULED: " zoom-scheduled-time) |
|
|
|
|
(concat zoom-summary |
|
|
|
|
" [[" zoom-link "][link]]\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) |
|
|
|
|
(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:" nil t) |
|
|
|
|
(setq zoom-passcode (get-buffer-current-line))) |
|
|
|
|
(beginning-of-buffer) |
|
|
|
|
(search-forward "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 |
|
|
|
|
(add-to-list 'mu4e-view-actions |
|
|
|
|
'("zCreate agenda item for meeting" . create-item-for-meeting) t) |
|
|
|
|
(advice-add 'mu4e-update-mail-and-index :around |
|
|
|
|
(lambda (orig-fun &rest args) |
|
|
|
|
"Only trigger an update if the server is the one that should |
|
|
|
|
currently be active; otherwise each mu4e instance will trigger an |
|
|
|
|
update" |
|
|
|
|
(when (string-equal server-name (kde-current-activity-name)) |
|
|
|
|
(apply orig-fun args)))) |
|
|
|
|
|
|
|
|
|
(advice-add 'mu4e~header-line-format :around |
|
|
|
|
(lambda (orig-fun &rest args) |
|
|
|
|
(let ((mu4e-use-fancy-chars t) |
|
|
|
|
(mu4e--mark-fringe-len 5)) |
|
|
|
|
(apply orig-fun args)))) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#+end_src |
|
|
|
|
#+end_src |
|
|
|
|
*** Recipient handling |
|
|
|
|
Add aliases (i.e. mailing groups) to [[file://~/.mailrc][the .mailrc file]] |
|
|
|
|
|