Created
October 10, 2020 20:33
-
-
Save agzam/7c7a1faea2df66ef593ec3ab47c0157f to your computer and use it in GitHub Desktop.
Find a message in a mailing list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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