From 8701afcf721098f7e58204d7ddeb1977cfa84336 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Fri, 8 Mar 2024 16:32:02 +0100 Subject: [PATCH] Have insert 'submit-emacs-patch' maintainers into X-Debbugs-Cc * lisp/mail/emacsbug.el (submit-emacs-patch-excluded-maintainers): Add new variable. (submit-emacs-patch): Go through all files mentioned in the diff and check for maintainers. --- lisp/mail/emacsbug.el | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index e89e66cc7cb..d6639c67c49 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -36,6 +36,7 @@ (require 'sendmail) (require 'message) +(require 'lisp-mnt) (defgroup emacsbug nil "Sending Emacs bug reports." @@ -497,6 +498,10 @@ report-emacs-bug-hook (when (get-buffer-window help) (quit-window nil (get-buffer-window help))))) +(defvar submit-emacs-patch-excluded-maintainers + '("emacs-devel@gnu.org") + "List of maintainer addresses for `submit-emacs-patch' to ignore.") + ;;;###autoload (defun submit-emacs-patch (subject file) "Send an Emacs patch to the Emacs maintainers. @@ -532,6 +537,29 @@ submit-emacs-patch (view-mode 1) (button-mode 1)) (compose-mail-other-window report-emacs-bug-address subject) + (let ((maint (let (files) + (with-temp-buffer + (insert-file-contents file) + (while (search-forward-regexp "^\\+\\{3\\} ./\\(.*\\)" nil t) + (push (expand-file-name + (match-string-no-properties 1) + source-directory) + files))) + (mapcan + (lambda (patch) + (seq-remove + (pcase-lambda (`(,_name . ,addr)) + (not (member addr submit-emacs-patch-excluded-maintainers))) + (lm-maintainers patch))) + files)))) + (when maint + (rfc822-goto-eoh) + (insert "X-Debbugs-Cc: " + (mapconcat + (pcase-lambda (`(,name . ,addr)) + (format "%s <%s>" name addr)) + maint ", ") + "\n"))) (message-goto-body) (insert "\n\n\n") (emacs-build-description) -- 2.44.0