From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63311: 30.0.50; [PATCH] smtpmail-send-it split Date: Tue, 07 Nov 2023 10:06:58 +0100 Message-ID: <878r7adj9p.fsf@ledu-giraud.fr> References: <87jzxmsyyr.fsf@ledu-giraud.fr> <87r0l9ejmm.fsf@ledu-giraud.fr> <834ji5aatw.fsf@gnu.org> <87bkcde4bz.fsf@ledu-giraud.fr> <83r0l98e6w.fsf@gnu.org> <87lebhckp2.fsf@ledu-giraud.fr> <83msvw904n.fsf@gnu.org> <87wmv0zb6v.fsf@ledu-giraud.fr> <8334xo8khh.fsf@gnu.org> <87ttq0nuq5.fsf@ledu-giraud.fr> <835y2g42zj.fsf@gnu.org> <87msvsfacs.fsf@ledu-giraud.fr> <834ji041jj.fsf@gnu.org> <87zfzrfaho.fsf@ledu-giraud.fr> <83msvr2gy3.fsf@gnu.org> <87jzqux4cu.fsf@ledu-giraud.fr> <83fs1i3kxy.fsf@gnu.org> <87pm0mepco.fsf@ledu-giraud.fr> <838r7a3cy6.fsf@gnu.org> <87h6lyeh4a.fsf@ledu-giraud.fr> <837cmu2qhu.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33113"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 63311@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 07 10:07:38 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0I3e-0008Nt-I5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Nov 2023 10:07:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0I3T-0005rF-DX; Tue, 07 Nov 2023 04:07:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0I3Q-0005qK-UR for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 04:07:24 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r0I3Q-0006jZ-KC for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 04:07:24 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0I42-0002oe-4U for bug-gnu-emacs@gnu.org; Tue, 07 Nov 2023 04:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Nov 2023 09:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63311 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63311-submit@debbugs.gnu.org id=B63311.169934806210794 (code B ref 63311); Tue, 07 Nov 2023 09:08:02 +0000 Original-Received: (at 63311) by debbugs.gnu.org; 7 Nov 2023 09:07:42 +0000 Original-Received: from localhost ([127.0.0.1]:41299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0I3i-0002o1-4G for submit@debbugs.gnu.org; Tue, 07 Nov 2023 04:07:42 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:32853) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0I3e-0002nq-M9 for 63311@debbugs.gnu.org; Tue, 07 Nov 2023 04:07:40 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=NfOXSqKW s/c+w9Wg1meL4qE+Teuy7txjonXtwXqw80w=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=+qgHhfFaEV5JkC7ug3g1zhqVdPkxtw Hdjcku8e/DFErapIAsFvm9Z+dcK92POfvrK9tJHXHQf+c6qIXAW2O0Dg== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=NfOXSqKWs/c+w9Wg 1meL4qE+Teuy7txjonXtwXqw80w=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=M7ag/WH86gs3G+aOlkyhBK6FJclm97vHxTtgv6 4dv4EH55a6SHboZuJ9caqR8y/Yk0h3wyYRUcjXkDphZQOz5IgWaM7VjPbi50KiEhl5rug0 WQc9iasnHG0/jCohdG68L4qu/MLE3SUXgjgAKWfJyfcB91MfG2IbtuEvJGuEnVnorZ1yzt yKNKx9Ehg8F5mxxRGmwwt7xm967x8/9Q1ESWCq/72rHo//qdI3PEcnrTSx2C9XGDUuYz4Q VjtmZJJoPR5Es1K1lSA+prnXcnytg8JW1ZnjWurg//VIPIeLDDBzJb7kBWTQ4DtQmkFW7t EKi7D6ylbAcdO7eG+nhOrm/A== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 6aaae193 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 7 Nov 2023 10:06:58 +0100 (CET) In-Reply-To: <837cmu2qhu.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 07 Nov 2023 05:26:21 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273917 Archived-At: Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: 63311@debbugs.gnu.org >> Date: Mon, 06 Nov 2023 21:55:49 +0100 >> >> Eli Zaretskii writes: >> >> >> If it is dead and (thread-last-error) returns nil maybe we can conclude >> >> that everything went well. But if (thread-last-error) returns a >> >> message, it could be message from any other Emacs thread: what to do in >> >> such case? >> > >> > Display a message about the error. >> >> I mean, the last error message could come from another thread not >> related in anyway to mail sending. No? > > It could, but why would there be other threads in this case? It seems that threads aren't used much in Emacs but isn't it dangerous to consider we're the only one using them? I don't if it would be easy but I think that it would be good to have a function like this: (thread-error thread) that would return the error message of the given thread like the global 'thread-last-error' does. >> >> Or worse: the thread is dead, (thread-last-error) returns >> >> nil... but it was cleared from another part of Emacs. >> > >> > This means it exited successfully. We could also maintain a data >> > structure where successfully-exiting threads will leave their success >> > status together with some id of the message they sent -- unlike a >> > thread that dies abruptly due to an error, a successful thread can >> > store the information in the data structure before exiting. >> >> Yes why not but then I'd have to modify internals of 'message-send': >> something I thought I could escape. > > I thought we were talking about a new function for this purpose, which > would replace message-send, no? Then that new function could have > this code. You're right it should be feasible inside this new function with something like that: --8<---------------cut here---------------start------------->8--- (make-thread #'(lambda () (if (message-send) (store-my-success) (store-my-failure)))) --8<---------------cut here---------------end--------------->8--- and then the main-thread will read those success or failure and act accordingly. -- Manuel Giraud