unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 63816@debbugs.gnu.org
Subject: bug#63816: 29.0.91; Don't prompt to save `send-mail-function' if in `emacs -q'
Date: Sat, 03 Jun 2023 11:24:05 +0300	[thread overview]
Message-ID: <835y859cnu.fsf@gnu.org> (raw)
In-Reply-To: <SJ0PR10MB548854A042E47663C1743130F3489@SJ0PR10MB5488.namprd10.prod.outlook.com> (message from Drew Adams on Wed, 31 May 2023 20:05:54 +0000)

> From: Drew Adams <drew.adams@oracle.com>
> Date: Wed, 31 May 2023 20:05:54 +0000
> 
> emacs -Q
> M-x report-emacs-bug
> Write a bug report, then `C-c C-c'.
> Confirm sending a report.
> Hit `RET' to accept `mail client' as the send method.
> 
> You're prompted to save that choice:
> 
>   Save this mail sending choice? (y or n) y
> 
> This prompt makes no sense.  You anyway get this error message:
> 
>   Setting 'send-mail-function' temporarily since "emacs -q" would
>   overwrite customizations

Can you try the patch below and see if solves this?

diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index f686c04..f88f69d 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -455,12 +455,14 @@ report-emacs-bug-hook
     (setq send-mail-function (sendmail-query-user-about-smtp))
     (when (derived-mode-p 'message-mode)
       (setq message-send-mail-function (message-default-send-mail-function))
-      (add-hook 'message-sent-hook
-                (lambda ()
-                  (when (y-or-n-p "Save this mail sending choice?")
-                    (customize-save-variable 'send-mail-function
-                                             send-mail-function)))
-                nil t)))
+      (unless (or (null user-init-file)
+                  (and (null custom-file) init-file-had-error))
+        (add-hook 'message-sent-hook
+                  (lambda ()
+                    (when (y-or-n-p "Save this mail sending choice?")
+                      (customize-save-variable 'send-mail-function
+                                               send-mail-function)))
+                  nil t))))
   (or report-emacs-bug-no-confirmation
       ;; mailclient.el does not need a valid From
       (eq send-mail-function 'mailclient-send-it)





  reply	other threads:[~2023-06-03  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 20:05 bug#63816: 29.0.91; Don't prompt to save `send-mail-function' if in `emacs -q' Drew Adams
2023-06-03  8:24 ` Eli Zaretskii [this message]
2023-06-03 14:54   ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=835y859cnu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63816@debbugs.gnu.org \
    --cc=drew.adams@oracle.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).