unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54931: [PATCH] Have submit-emacs-patch prompt for patch file before subject
@ 2022-04-14 10:16 Philip Kaludercic
  2022-04-14 13:52 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Kaludercic @ 2022-04-14 10:16 UTC (permalink / raw)
  To: 54931

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

Tags: patch


When sending patches using submit-emacs-patch, I usually want to reuse
the commit title for the message subject.  As a minor convenience, this
can be guessed when the patch file is prompted before the subject,
allowing for a default value to be provided by extracting the "Subject"
header from the patch file.

In GNU Emacs 29.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2022-04-10 built on viero
Repository revision: 0023cfdc4e6d348519198cf75553d1afad0ed153
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Guix System

Configured using:
 'configure
 PKG_CONFIG_PATH=/home/philip/.guix-profile/lib/pkgconfig:/home/philip/.guix-profile/share/pkgconfig'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Have-submit-emacs-patch-prompt-for-patch-file-before.patch --]
[-- Type: text/patch, Size: 1302 bytes --]

From 5a0509166c184178f65506615db225eac9426e41 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Thu, 14 Apr 2022 12:13:27 +0200
Subject: [PATCH] Have submit-emacs-patch prompt for patch file before subject

* emacsbug.el (submit-emacs-patch): Prompt for patch file and use that
  to guess the subject.
---
 lisp/mail/emacsbug.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 1bda609d10..3cc727e6cf 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -488,7 +488,14 @@ submit-emacs-patch
 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)
-- 
2.34.0


[-- Attachment #3: Type: text/plain, Size: 24 bytes --]


-- 
	Philip Kaludercic

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#54931: [PATCH] Have submit-emacs-patch prompt for patch file before subject
  2022-04-14 10:16 bug#54931: [PATCH] Have submit-emacs-patch prompt for patch file before subject Philip Kaludercic
@ 2022-04-14 13:52 ` Lars Ingebrigtsen
  2022-04-14 16:41   ` Philip Kaludercic
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-14 13:52 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 54931

Philip Kaludercic <philipk@posteo.net> writes:

> When sending patches using submit-emacs-patch, I usually want to reuse
> the commit title for the message subject.  As a minor convenience, this
> can be guessed when the patch file is prompted before the subject,
> allowing for a default value to be provided by extracting the "Subject"
> header from the patch file.

Looks good to me, please go ahead and push.

> +     (list (read-string (format-prompt "This patch is about" guess )
> +                        nil nil guess)

But without that space between "guess" and ")".  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#54931: [PATCH] Have submit-emacs-patch prompt for patch file before subject
  2022-04-14 13:52 ` Lars Ingebrigtsen
@ 2022-04-14 16:41   ` Philip Kaludercic
  0 siblings, 0 replies; 3+ messages in thread
From: Philip Kaludercic @ 2022-04-14 16:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 54931

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> When sending patches using submit-emacs-patch, I usually want to reuse
>> the commit title for the message subject.  As a minor convenience, this
>> can be guessed when the patch file is prompted before the subject,
>> allowing for a default value to be provided by extracting the "Subject"
>> header from the patch file.
>
> Looks good to me, please go ahead and push.

Done,

>> +     (list (read-string (format-prompt "This patch is about" guess )
>> +                        nil nil guess)
>
> But without that space between "guess" and ")".  

done,

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Reading through time_cmp, I didn't understand why the lisp_time struct
>> was calculated for the first argument before checking if both are eq.
>>>From what I see lisp_time struct is not a destructive function, so it
>> should be possible to call the function when calculating the lisp_time
>> struct for the second argument.
>
> Looks good to me; please go ahead and push.

and done.

-- 
	Philip Kaludercic





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-14 16:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-14 10:16 bug#54931: [PATCH] Have submit-emacs-patch prompt for patch file before subject Philip Kaludercic
2022-04-14 13:52 ` Lars Ingebrigtsen
2022-04-14 16:41   ` Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).