From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#54931: [PATCH] Have submit-emacs-patch prompt for patch file before subject Date: Thu, 14 Apr 2022 10:16:11 +0000 Message-ID: <8735ig55sk.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13863"; mail-complaints-to="usenet@ciao.gmane.io" To: 54931@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 14 12:17:41 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1newXk-0003Mi-1F for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Apr 2022 12:17:40 +0200 Original-Received: from localhost ([::1]:39440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1newXi-0006Bc-Km for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Apr 2022 06:17:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1newXA-0006BT-6L for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2022 06:17:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1newX8-0000QL-Sy for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2022 06:17:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1newX8-000468-OT for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2022 06:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Apr 2022 10:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54931 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164993137915687 (code B ref -1); Thu, 14 Apr 2022 10:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Apr 2022 10:16:19 +0000 Original-Received: from localhost ([127.0.0.1]:55284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1newWQ-00044x-QR for submit@debbugs.gnu.org; Thu, 14 Apr 2022 06:16:19 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:55186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1newWP-00044q-DE for submit@debbugs.gnu.org; Thu, 14 Apr 2022 06:16:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1newWP-00069T-5N for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2022 06:16:17 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:55425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1newWN-0000N6-7A for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2022 06:16:16 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D824624002A for ; Thu, 14 Apr 2022 12:16:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1649931372; bh=6zHGAtTWYFUur/kYaty4GVzAMn7OtJB29rEYoNHUxDE=; h=From:To:Subject:Autocrypt:Date:From; b=ewwJArfVyopOq0jNZt/QiyxyhwBESuQ5oK6r1yz5rJSK3fw6+iuVWr9OOFpo6kHLa 6BZvG6ShadCuRv3ghWpFsQWwPXVvAhJNAuTJ0UFsisUG7YdEK751mCOt5mywT/5+uR IecddBla9vk3xqpEenHrOPxYTLeGAQDd3kN7oHqCwp2Bo8Y94mUeBpQZIWAK1Yt87X Yb3EsEzWnuf2hwvGdIqu80dvqWkB/cY/gbEMVY7HNqu1G2HbYOcEwL7j2k6xvdV9iN nTg7Th6NG7vWr6VjyXHka8PzUzx7UVEokrn+lr52MEDy8wrsf3mZZXMTsY8IXWcvOV l23C/JXOfyyTw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KfFjS1vS5z9rxH for ; Thu, 14 Apr 2022 12:16:12 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:229859 Archived-At: --=-=-= Content-Type: text/plain 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' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Have-submit-emacs-patch-prompt-for-patch-file-before.patch >From 5a0509166c184178f65506615db225eac9426e41 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic 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 --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=--