]> git.eshelyaron.com Git - emacs.git/commitdiff
Have submit-emacs-patch prompt for patch file before subject
authorPhilip Kaludercic <philipk@posteo.net>
Thu, 14 Apr 2022 10:13:27 +0000 (12:13 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Thu, 14 Apr 2022 16:39:35 +0000 (18:39 +0200)
* emacsbug.el (submit-emacs-patch): Prompt for patch file and use that
  to guess the subject.

lisp/mail/emacsbug.el

index 1bda609d1057e5ce7a0711fb1c785408a116a632..8cb4a00009f9cfb67bb65776714e1c9981316908 100644 (file)
@@ -488,7 +488,14 @@ and send the mail again%s."
 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: ")
+  (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)