Function: submit-emacs-patch
submit-emacs-patch is an autoloaded, interactive and byte-compiled
function defined in emacsbug.el.gz.
Signature
(submit-emacs-patch SUBJECT FILE)
Documentation
Send an Emacs patch to the Emacs maintainers.
Interactively, you will be prompted for SUBJECT and a patch FILE name (which will be attached to the mail). You will end up in a Message buffer where you can explain more about the patch.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/mail/emacsbug.el.gz
;;;###autoload
(defun submit-emacs-patch (subject file)
"Send an Emacs patch to the Emacs maintainers.
Interactively, you will be prompted for SUBJECT and a patch FILE
name (which will be attached to the mail). You will end up in a
Message buffer where you can explain more about the patch."
(interactive
(let* ((file (read-file-name "Patch file name: "))
(guess (with-temp-buffer
(insert-file-contents file)
(mail-fetch-field "Subject"))))
(list (read-string (format-prompt "This patch is about" guess)
nil nil guess)
file)))
(switch-to-buffer "*Patch Help*")
(let ((inhibit-read-only t))
(erase-buffer)
(insert "Thank you for considering submitting a patch to the Emacs project.\n\n"
"Please describe what the patch fixes (or, if it's a new feature, what it\n"
"implements) in the mail buffer below. When done, use the "
(substitute-command-keys "\\<message-mode-map>\\[message-send-and-exit] command\n")
"to send the patch as an email to the Emacs issue tracker.\n\n"
"If this is the first time you're submitting an Emacs patch, please\n"
"read the ")
(insert-text-button
"CONTRIBUTE"
'action (lambda (_)
(view-buffer
(find-file-noselect
(expand-file-name "CONTRIBUTE" installation-directory)))))
(insert " file first.\n")
(goto-char (point-min))
(view-mode 1)
(button-mode 1))
(compose-mail-other-window report-emacs-bug-address subject)
(message-goto-body)
(insert "\n\n\n")
(emacs-build-description)
(mml-attach-file file "text/patch" nil "attachment")
(message-goto-body)
(message "Write a description of the patch and use %s to send it"
(substitute-command-keys "\\[message-send-and-exit]"))
(add-hook 'message-send-hook
(lambda ()
(message-goto-body)
(insert "Tags: patch\n\n"))
nil t)
(message-add-action
(lambda ()
;; Bury the help buffer (if it's shown).
(when-let ((help (get-buffer "*Patch Help*")))
(when (get-buffer-window help)
(quit-window nil (get-buffer-window help)))))
'send))