help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Workflow with mu4e + magit for sending patchsets to guix?


From: Pierre Neidhardt
Subject: Re: Workflow with mu4e + magit for sending patchsets to guix?
Date: Tue, 01 Dec 2020 10:10:56 +0100

Ah!  That's good to know!

So here is my final, hopefully fully-functioning version then:

--8<---------------cut here---------------start------------->8---
(defvar ambrevar/known-mailing-list-archives
  '(("help-guix@gnu.org" . "guix")
    ("guix-devel@gnu.org" . "guix")
    ("debbugs.gnu.org" . "guix"))
  "Alist of mail adresses and their Yhetil name.
Alternatively the key may just be a host name against which a
recipient will be matched.")

(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)))
         (match-address (lambda (address-or-host)
                          (if (string-match "@" address-or-host)
                              (member address-or-host all-addresses)
                            (seq-find (lambda (address)
                                        (string-match address-or-host address))
                                      all-addresses))))
         (mailing-list (alist-get
                        (seq-find match-address
                                  (mapcar #'car 
ambrevar/known-mailing-list-archives))
                        ambrevar/known-mailing-list-archives
                        nil nil #'string=)))
    (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))

(setq notmuch-show-stash-mlarchive-link-default "Yhetil")
--8<---------------cut here---------------end--------------->8---

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]