From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65387: [PATCH] New user option 'submit-emacs-patch-display-help' Date: Sun, 20 Aug 2023 13:35:56 +0200 Message-ID: References: <83jztqyfbt.fsf@gnu.org> <83fs4exn5e.fsf@gnu.org> Reply-To: Eshel Yaron 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="29266"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 65387@debbugs.gnu.org To: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 20 13:37:08 2023 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 1qXgjz-0007Nm-FZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 20 Aug 2023 13:37:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXgjt-00045g-P0; Sun, 20 Aug 2023 07:37:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXgjs-00045X-Uj for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 07:37:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qXgjs-0005pU-MQ for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 07:37:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXgju-0003Tn-7U for bug-gnu-emacs@gnu.org; Sun, 20 Aug 2023 07:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Aug 2023 11:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65387 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65387-submit@debbugs.gnu.org id=B65387.169253136613298 (code B ref 65387); Sun, 20 Aug 2023 11:37:02 +0000 Original-Received: (at 65387) by debbugs.gnu.org; 20 Aug 2023 11:36:06 +0000 Original-Received: from localhost ([127.0.0.1]:53243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXgiz-0003SP-I6 for submit@debbugs.gnu.org; Sun, 20 Aug 2023 07:36:06 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:49390 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXgix-0003SH-Mu for 65387@debbugs.gnu.org; Sun, 20 Aug 2023 07:36:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1692531361; bh=cKxF94EAZiqT+EwCaZpeMIc4/KGFTtFvNYz1V5b7CUc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=R+v9FtLOLzqV0q99EOvzvxmc3bS6bDiOJDcH6ghH5Wcgos2fdSs8nk6XVuVv45hsC eSjvdiJZKmohHlUlfCTmwUI4U1L8ZVEFwXgO5FEJG2r7KalQjhz8oCKgQs6J0mpDb9 Twr54d71whXUmC/9cg/1J7m+vkEVWG1tFFtHln4POHM4D/nPb0Cis0eYsSmcjdEO93 0RFd6IY1xI/aAuuF6LU5oet/6w2mb3XZKVG8m6Mls1+DGEZphNZVRlxzmmguj79W35 MRfemedZyQRyS0iiAPL5kdA2t9NewJAFlAwXfbzQNHRGrEssLCC53cz3MEPJ1XnP7S Keh4VIExe/0nw== In-Reply-To: ("Daniel =?UTF-8?Q?Mart=C3=ADn?="'s message of "Sun, 20 Aug 2023 11:59:47 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267988 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Daniel Mart=C3=ADn writes: > Instead of just a toggle, we could make the new option a tristate: > > - `nil`: Only displays the buffer to compose the email (what is proposed = in > this bug report). > - `help`: Displays instructions on how to send the patch (current > behavior).=20=20 > - `patch`: Displays the patch that you want to submit in the split > window. Good idea, thanks. I've added something like that in the following updated patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-New-user-option-submit-emacs-patch-display-help.patch >From 10c943cbf340255d0577a03fe4b3d74af840a9e2 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 19 Aug 2023 21:24:34 +0200 Subject: [PATCH v2] New user option 'submit-emacs-patch-display-help' This lets users prevent 'submit-emacs-patch' from displaying a buffer with instructions about submitting patches when they no longer need it. * lisp/mail/emacsbug.el (submit-emacs-patch-display-help): New user option. (submit-emacs-patch): Use it. * doc/emacs/trouble.texi (Sending Patches): Document it. * etc/NEWS: Announce it. --- doc/emacs/trouble.texi | 9 +++++++ etc/NEWS | 7 ++++++ lisp/mail/emacsbug.el | 54 ++++++++++++++++++++++++++---------------- 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index d2e8ac3452a..042637ed8fc 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -1336,6 +1336,15 @@ Sending Patches form that is clearly safe to install. @end itemize +@vindex submit-emacs-patch-display-help +By default, @kbd{M-x submit-emacs-patch} displays a buffer with some +instructions alongside the Message mode buffer. If you're already +familiar with these instructions after submitting a patch or two, you +can disable this help by customizing the user option +@code{submit-emacs-patch-display-help} to @code{nil}. If you set this +option to @code{patch}, Emacs displays the patch you're about to +submit instead of the instructions buffer. + @node Contributing @section Contributing to Emacs Development @cindex contributing to Emacs diff --git a/etc/NEWS b/etc/NEWS index 6588299c532..5ea8a204522 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -99,6 +99,13 @@ This allows the user to customize the prompt that is appended by 'yes-or-no-p' when asking questions. The default value is "(yes or no) ". ++++ +** New user option 'submit-emacs-patch-display-help'. +You can set this user option to nil to prevent 'submit-emacs-patch' +from displaying a help buffer with instructions for submitting +patches. If you set this option to 'patch', Emacs displays the patch +you're about to submit instead of the instructions buffer. + --- ** New face 'display-time-date-and-time'. This is used for displaying the time and date components of diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index bebaad720db..b93aed47bac 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -50,6 +50,17 @@ report-emacs-bug-no-explanations "If non-nil, suppress the explanations given for the sake of novice users." :type 'boolean) +(defcustom submit-emacs-patch-display-help t + "Whether `submit-emacs-patch' displays help in another buffer. + +If nil, display only the message buffer without additional help. If this is +the symbol `patch', display the patch you are submitting in another buffer. +Any other value says to display a buffer with instructions for submitting +patches (this is the default for the sake of novice users)." + :type '(choice (const :tag "Do not display help" nil) + (const :tag "Display instructions" t) + (const :tag "Display patch" patch))) + ;; User options end here. (defvar report-emacs-bug-orig-text nil @@ -509,26 +520,29 @@ submit-emacs-patch (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-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)) + (pcase submit-emacs-patch-display-help + ('patch (find-file file)) + ((pred (not null)) + (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-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") -- 2.41.0 --=-=-=--