zimoun <[email protected]> writes: > And <https://yhetil.org> serves the mapping via public-inbox. > Concretely, I do ’cl’ (notmuch-show-stash-mlarchive-link) reading your > message, select the archive and I get: > > <https://yhetil.org/guix-user/[email protected]> > > Select the archive because by default it is linux-kernel related > archives: LKML, MARC, etc. even if I do not know about Gmane. My config > is: > > --8<---------------cut here---------------start------------->8--- > ;; c l stashes a hyperlink using Message-ID instead of numbering, e.g.: > ;; > https://yhetil.org/guix-user/[email protected] > ;; vs https://lists.gnu.org/archive/html/help-guix/2020-10/msg00177.html > (mapcar (lambda (what) > (add-to-list 'notmuch-show-stash-mlarchive-link-alist > `(,what . ,(concat "https://yhetil.org/" what "/")))) > (reverse'("guix-devel" > "guix-user" > "guix-science" > "gwl" > "guix-bugs" > "guix-patches"))) > --8<---------------cut here---------------end--------------->8--- > > (Instead of manually selecting the archive, an helper function could > parse the header fields and do the job but I have not been annoyed > enough yet. :-))
At your service:
--8<---------------cut here---------------start------------->8---
(defvar ambrevar/known-mailing-list-archives
'(("[email protected]" . "guix-user")
("[email protected]" . "guix-devel")
("guix-bugs" . "guix-bugs")
("guix-patches" . "guix-patches"))
"Alist of mail adresses and their Yhetil name.")
(defun ambrevar/guess-yhetil-link (message-id)
(let* ((all-addresses
(mapcar #'second
(mail-extract-address-components
(mapconcat #'identity
(list
(notmuch-show-get-header :To)
(notmuch-show-get-header :Cc))
", ")
'all)))
(mailing-list
(cdr (seq-find
(lambda (pair)
(member (car pair) all-addresses))
ambrevar/known-mailing-list-archives))))
(when mailing-list
(concat "https://yhetil.org/"
mailing-list "/" message-id))))
(add-to-list 'notmuch-show-stash-mlarchive-link-alist
(cons "Yhetil" #'ambrevar/guess-yhetil-link))
--8<---------------cut here---------------end--------------->8---
I had to create an alist to map between the address of the mailing list
and the Yhetil name because in the case of guix-user, the address is not
the same (help-guix). I wonder why.
Cheers!
--
Pierre Neidhardt
https://ambrevar.xyz/
signature.asc
Description: PGP signature
