Subject: bug#23799: 25.0.90; Replying "no" to send bug report means you cannot later send it

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 28 Jul 2019 13:48:35 +0200

Drew Adams <[email-masked]> writes:

> Hit C-c C-c to send a bug report, then reply "no", perhaps because you
> want to change something before submitting the report.
>
> Now try C-c C-c again.
>
> You get an error/message saying:
>
>   message-send: No methods specified to send by

It looks like this puzzling behaviour is because of this puzzling code:

      (goto-char (point-min))
      (if (search-forward "To: ")
          (delete-region (point) (line-end-position)))
      (if report-emacs-bug-send-hook
          (kill-local-variable report-emacs-bug-send-hook))

Which was introduced by the patch below, apparently, which doesn't say
anything about why it's removing the To: header or why it's removing the
hook (you don't get any queries the second time around, either).

Hm...  Oh!

I didn't even notice that when you type "no", it switches out the help
buffer text:

      (with-output-to-temp-buffer "*Bug Help*"
	(princ (substitute-command-keys
                (format "\
You invoked the command M-x report-emacs-bug,
but you decided not to mail the bug report to the Emacs maintainers.

If you want to mail it to someone else instead,
please insert the proper e-mail address after \"To: \",
and send the mail again%s."

So the intention here is that if you say "no", then you're never ever
going to send the message to the Emacs maintainers.  I think that's a
pretty unexpected thing to infer from just the "no".

I've now removed that code that removes the To and the hook, which then
allows the user to change their minds.

commit fe1d8b33cbeadad8cd9c186553ecf87b8bbf314d
Author: Kenichi Handa <[email-masked]>
Date:   Tue Jul 15 08:23:58 1997 +0000

    (report-emacs-bug-run-tersely): New variable
    (report-emacs-bug): Insert warnings for novice usres in *mail* buffer.
    Set enable-multibyte-characters to nil.
    (report-emacs-bug-hook): Check non-English letters.  Confirm about
    sending a report to FSF.

diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -150,1 +187,11 @@
-	(error "No text entered in bug report"))))
+    (if (or report-emacs-bug-run-tersely
+	    (yes-or-no-p
+	     "Do you surely send this mail to Free Software Foundation? "))
+	;; Just send the current mail.
+	nil
+      (goto-char (point-min))
+      (if (search-forward "To: ")
+	  (let ((pos (point)))
+	    (end-of-line)
+	    (delete-region pos (point))))
+      (kill-local-variable 'mail-send-hook)

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