Skip to content

Instantly share code, notes, and snippets.

@agzam
Created October 10, 2020 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agzam/7c7a1faea2df66ef593ec3ab47c0157f to your computer and use it in GitHub Desktop.
Save agzam/7c7a1faea2df66ef593ec3ab47c0157f to your computer and use it in GitHub Desktop.
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