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: Thu, 26 Nov 2020 10:51:41 +0100

Fixed:

--8<---------------cut here---------------start------------->8---
(defvar ambrevar/known-mailing-list-archives
  '(("help-guix@gnu.org" . "guix-user")
    ("guix-devel@gnu.org" . "guix-devel")
    ("debbugs.gnu.org" . "guix-bugs"))
  "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)))
         (mailing-list
          (cdr (seq-find
                (lambda (pair)
                  (let ((address-or-host (car pair)))
                    (if (string-match "@" address-or-host)
                        (member address-or-host all-addresses)
                      (seq-find (lambda (address)
                                  (string-match address-or-host address))
                                all-addresses))))
                ambrevar/known-mailing-list-archives))))
    (when mailing-list
      (concat "https://yhetil.org/";
              mailing-list "/" message-id))))

(defun ambrevar/guess-yhetil-link-prefer-patches (message-id)
  (let ((ambrevar/known-mailing-list-archives
         (copy-alist
          ambrevar/known-mailing-list-archives)))
    (push '("debbugs.gnu.org" . "guix-patches")
          ambrevar/known-mailing-list-archives)
    (ambrevar/guess-yhetil-link message-id)))

(add-to-list 'notmuch-show-stash-mlarchive-link-alist
             (cons "Yhetil" #'ambrevar/guess-yhetil-link))
(add-to-list 'notmuch-show-stash-mlarchive-link-alist
             (cons "Yhetil/patches" 
#'ambrevar/guess-yhetil-link-prefer-patches))

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

The last line should be useful ;)

Note that I've set two entries, one that prefer guix-patches over
guix-bugs because they seem to use the same recipient domain
(debbugs.gnu.org) and I don't know how to differentiate the two.

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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