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 "sThis patch is about: \nfPatch file name: ")
  (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 `C-c C-c' command\n"
            "to send the patch as an email to the Emacs issue tracker.\n\n"
            "If this is the first time you've submitted 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))
  (message-mail-other-window report-emacs-bug-address subject)
  (insert "\n\n\n")
  (emacs-bug--system-description)
  (mml-attach-file file "text/patch" nil "attachment")
  (message-goto-body)
  (message "Write a description of the patch and use `C-c C-c' to send it")
  (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))