all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Garreau\, Alexandre" <galex-713@galex-713.eu>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 33225@debbugs.gnu.org, michael albinus <michael.albinus@gmx.de>
Subject: bug#33225: [debbugs.el] Don't send control message immediately
Date: Thu, 01 Nov 2018 15:28:54 +0100	[thread overview]
Message-ID: <871s84g9cp.fsf@portable.galex-713.eu> (raw)
In-Reply-To: <87k1lxhtfc.fsf@gmail.com> (Noam Postavsky's message of "Thu, 01 Nov 2018 08:29:59 -0400")

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

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
“test it to see how it looks” thinking of “cancelling at the last
moment”, and discovered the mail was already sent before I could even
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’d 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: debbugs-gnu_confirm-control.patch --]
[-- Type: text/x-diff, Size: 3149 bytes --]

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)))

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


[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

  reply	other threads:[~2018-11-01 14:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 12:29 bug#33225: [debbugs.el] Don't send control message immediately Noam Postavsky
2018-11-01 14:28 ` Garreau, Alexandre [this message]
2018-11-02 10:30   ` Michael Albinus
2018-11-02 10:23 ` Michael Albinus
2019-01-04 14:38   ` Michael Albinus
2019-02-27  8:45     ` Michael Albinus
2019-02-28  1:10       ` Noam Postavsky
2019-02-28  7:10         ` Michael Albinus
2019-03-30  2:43   ` Noam Postavsky
2019-03-31 10:21     ` Michael Albinus
2019-03-31 21:27       ` Noam Postavsky
2019-04-01  7:35         ` Michael Albinus
2019-04-01 13:34           ` Noam Postavsky
2019-04-01 14:52             ` Michael Albinus
2019-04-01 22:47               ` Noam Postavsky
2019-04-01 22:59                 ` Noam Postavsky
2019-04-02  5:52                 ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871s84g9cp.fsf@portable.galex-713.eu \
    --to=galex-713@galex-713.eu \
    --cc=33225@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.