Skip to content

Instantly share code, notes, and snippets.

@agzam

agzam/funcs.el

Created Oct 10, 2020
Embed
What would you like to do?
Find a message in a mailing list
(defun mu4e-action-find-in-mailing-list (msg)
"Find message in mailing-list archives"
(interactive)
(let* ((mlist (mu4e-message-field msg :mailing-list))
(msg-id (mu4e-message-field msg :message-id))
(url
(pcase mlist
;; gnu.org
((pred (lambda (x) (string-suffix-p "gnu.org" x)))
(concat
"https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query="
(concat
(url-hexify-string
(concat
"+message-id:<"
msg-id
">"))
"&submit=" (url-hexify-string "Search!")
"&idxname="
(replace-regexp-in-string "\.gnu\.org" "" mlist))))
;; google.groups
((pred (lambda (x) (string-suffix-p "googlegroups.com" x)))
(concat
"https://groups.google.com/forum/#!topicsearchin/"
(replace-regexp-in-string "\.googlegroups\.com" "" mlist)
"/messageid$3A"
(url-hexify-string (concat "\"" msg-id "\"")))))))
(when url
(message "opening url: " url)
(browse-url url))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment