bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43386: 27.1; Regression in `report-emacs-bug'


From: Lars Ingebrigtsen
Subject: bug#43386: 27.1; Regression in `report-emacs-bug'
Date: Mon, 14 Sep 2020 18:15:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> The call to sendmail-query-user-about-smtp is the one that asks about
> how to send, and allows to select mailclient.  But the conditions to
> call it are false, and the rest is history.

Yes, it's due to

commit 3a59cc84069376802ba8fd731b524d78db58262c
Author:     Stefan Monnier <monnier@iro.umontreal.ca>
AuthorDate: Tue Jul 30 16:37:01 2019 -0400

    * lisp/gnus/message.el: Reduce redundancy with send-mail-function
    
which changed the default of message-send-mail-function.

However, even with that fixed, the code there is misguided.  emacsbug
queries for the method:

  (when (or (and (derived-mode-p 'message-mode)
                 (eq message-send-mail-function 'sendmail-query-once))
            (and (not (derived-mode-p 'message-mode))
                 (eq send-mail-function 'sendmail-query-once)))
    (sendmail-query-user-about-smtp)

but doesn't do anything with it -- sendmail-query-user-about-smtp just
returns a function.

This is how that function is supposed to be used:

(defun sendmail-query-once ()
  "Query for `send-mail-function' and send mail with it.
This also saves the value of `send-mail-function' via Customize."
  ;; If send-mail-function is already setup, we're incorrectly called
  ;; a second time, probably because someone's using an old value
  ;; of send-mail-function.
  (if (not (eq send-mail-function #'sendmail-query-once))
      (funcall send-mail-function)
    (let ((function (sendmail-query-user-about-smtp)))
      (funcall function)
      (when (y-or-n-p "Save this mail sending choice?")
        (setq send-mail-function function)
        (customize-save-variable 'send-mail-function function)))))

Notice that we offer to set it -- after we've seen that the user can
send successfully, which we can't do from that hook.

So to make this work sensibly requires some refactoring of the code.
I'll have a look at it tomorrowish.

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]