Hi Pierre, Thanks!
On Wed, 25 Nov 2020 at 10:19, Pierre Neidhardt <m...@ambrevar.xyz> wrote: > --8<---------------cut here---------------start------------->8--- > (defvar ambrevar/known-mailing-list-archives > '(("help-guix@gnu.org" . "guix-user") > ("guix-de...@gnu.org" . "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--- Neat! It fails for Bugs/Patches since the addresses are 12...@debbugs.gnu.org. So the “all-addresses” should be a bit smarter. But, anyway because I do not use yhetil to refer to Bug/Patch but issues.guix.gnu.org. Cheers, simon