From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Garreau\, Alexandre" Newsgroups: gmane.emacs.bugs Subject: bug#33225: [debbugs.el] Don't send control message immediately Date: Thu, 01 Nov 2018 15:28:54 +0100 Message-ID: <871s84g9cp.fsf@portable.galex-713.eu> References: <87k1lxhtfc.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1541083022 11229 195.159.176.226 (1 Nov 2018 14:37:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2018 14:37:02 +0000 (UTC) User-Agent: Gnus (5.13), GNU Emacs 25.1.1 (i686-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-15, modified by Debian Cc: 33225@debbugs.gnu.org, michael albinus To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 01 15:36:57 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gIE5e-0002kn-Vo for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Nov 2018 15:36:55 +0100 Original-Received: from localhost ([::1]:42353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIE7l-0005fq-Gi for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Nov 2018 10:39:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIE7P-000589-2h for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 10:38:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIDy2-0000LH-Hq for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 10:29:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54345) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gIDy2-0000Jy-Bq for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 10:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gIDy2-0004oY-3i for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 10:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Garreau\, Alexandre" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Nov 2018 14:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33225 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 33225-submit@debbugs.gnu.org id=B33225.154108254018497 (code B ref 33225); Thu, 01 Nov 2018 14:29:02 +0000 Original-Received: (at 33225) by debbugs.gnu.org; 1 Nov 2018 14:29:00 +0000 Original-Received: from localhost ([127.0.0.1]:58603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gIDxz-0004oH-PC for submit@debbugs.gnu.org; Thu, 01 Nov 2018 10:29:00 -0400 Original-Received: from portable.galex-713.eu ([89.234.186.82]:46944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gIDxx-0004o8-IT for 33225@debbugs.gnu.org; Thu, 01 Nov 2018 10:28:58 -0400 Original-Received: from localhost ([::1] helo=portable.galex-713.eu) by portable.galex-713.eu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gIDxu-0006WW-S9; Thu, 01 Nov 2018 15:28:54 +0100 PGP-FINGERPRINT: E109 9988 4197 D7CB B0BC 5C23 8DEB 24BA 867D 3F7F Accept-Language: fr, en, eo, it, br In-Reply-To: <87k1lxhtfc.fsf@gmail.com> (Noam Postavsky's message of "Thu, 01 Nov 2018 08:29:59 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151892 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2018-11-01 at 08:29, Noam Postavsky wrote: > As mentioned in [1], I have a modified version of > debbugs-gnu-send-control-message which just creates the message (or > edits the current one) rather than sending it right away. I believe this is the most straightforward solution to the problem of control messages sending too fast for the newcomer user. However, I guess this is a feature more than a bug for most used users, and this would have been only useful for the first time to me, when I wanted to =E2=80=9Ctest it to see how it looks=E2=80=9D thinking of =E2=80=9Ccancelli= ng at the last moment=E2=80=9D, and discovered the mail was already sent before I could ev= en understand what was happening (and take the time to document more myself on what was the control message really meaning). Sure if I saw a message-mode buffer before, at this moment, I=E2=80=99d have canceled, but = that would only have been useful the first time: then it would have become tiring, so I would have disabled it to come back the simple behavior, and loose the benefit of the additional security-check step. > I'm posting it here as a patch to debbugs-gnu.el. It might make sense > to replace the current debbugs-gnu-send-control-message, or just > factor out the common parts, I haven't really thought much about that. > > [1]: http://lists.gnu.org/archive/html/help-debbugs/2018-10/msg00014.html What I suggested later instead was asking for confirmation for certain control messages that might uselessly garble and bloat the bug history, while letting go more common and useful messages that might otherwise anyway be undone without semantic overhead [2], first suggestion was just about asking for confirmation about certain messages and not others, so I attach the already suggested [3] patch here for better referencing of it. But in last message [2] I argued in favor of better discrimination among control messages and potentially clarifying their meaning and better linking doc. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=debbugs-gnu_confirm-control.patch diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el index 5466d6518..ea61e96bb 100644 --- a/packages/debbugs/debbugs-gnu.el +++ b/packages/debbugs/debbugs-gnu.el @@ -1462,6 +1462,32 @@ returned by `debbugs-gnu-bugs'." (number-sequence (string-to-number from) (string-to-number to))) result)))))))) +(defconst debbugs-gnu-control-messages + '("serious" "important" "normal" "minor" "wishlist" + "done" "donenotabug" "donewontfix" "doneunreproducible" + "unarchive" "unmerge" "reopen" "close" + "merge" "forcemerge" + "block" "unblock" + "owner" "noowner" + "forwarded" "notforwarded" + "invalid" + "reassign" + "retitle" + "patch" "wontfix" "moreinfo" "unreproducible" "fixed" "notabug" + "pending" "help" "security" "confirmed" "easy" + "usertag") + "List of control messages accepted by Debbugs. +All are accepted and processed by `debbugs-gnu-send-control-message' +accordingly.") + +(defcustom debbugs-gnu-confirm-control-messages '("owner") + "List of control messages asking for confirmation. +Each message listed will make `debbugs-gnu-send-control-message' +ask for confirmation before sending control message mail." + :type (cons 'set (mapcar (apply-partially #'list 'const) + debbugs-gnu-control-messages)) + :group 'debbugs-gnu) + (defun debbugs-gnu-send-control-message (message &optional reverse) "Send a control message for the current bug report. You can set the severity or add a tag, or close the report. If @@ -1473,19 +1499,7 @@ removed instead." (interactive (list (completing-read "Control message: " - '("serious" "important" "normal" "minor" "wishlist" - "done" "donenotabug" "donewontfix" "doneunreproducible" - "unarchive" "unmerge" "reopen" "close" - "merge" "forcemerge" - "block" "unblock" - "owner" "noowner" - "forwarded" "notforwarded" - "invalid" - "reassign" - "retitle" - "patch" "wontfix" "moreinfo" "unreproducible" "fixed" "notabug" - "pending" "help" "security" "confirmed" "easy" - "usertag") + debbugs-gnu-control-messages nil t) current-prefix-arg)) (let* ((id (or (debbugs-gnu-current-id t) @@ -1585,11 +1599,14 @@ removed instead." (format "tags %d%s %s\n" id (if reverse " -" "") message)))) - (funcall (or debbugs-gnu-send-mail-function send-mail-function)) - (remhash id debbugs-cache-data) - (message-goto-body) - (message "Control message sent:\n%s" - (buffer-substring-no-properties (point) (1- (point-max))))))) + (unless (and (member message debbugs-gnu-confirm-control-messages) + (not (y-or-n-p (format "Really send `%s' control message? " + message)))) + (funcall (or debbugs-gnu-send-mail-function send-mail-function)) + (remhash id debbugs-cache-data) + (message-goto-body) + (message "Control message sent:\n%s" + (buffer-substring-no-properties (point) (1- (point-max)))))))) (defvar debbugs-gnu-usertags-mode-map (let ((map (make-sparse-keymap))) --=-=-= Content-Type: text/plain [2] http://lists.gnu.org/archive/html/help-debbugs/2018-11/msg00006.html [3] http://lists.gnu.org/archive/html/help-debbugs/2018-11/msg00001.html --=-=-=--