From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63311: 30.0.50; [PATCH] smtpmail-send-it split Date: Sun, 05 Nov 2023 17:46:40 +0200 Message-ID: <835y2g42zj.fsf@gnu.org> References: <87jzxmsyyr.fsf@ledu-giraud.fr> <83ttwqhahy.fsf@gnu.org> <874joq34bk.fsf@ledu-giraud.fr> <83o7mygevr.fsf@gnu.org> <87wn1hzv9j.fsf@ledu-giraud.fr> <871qjoe7cw.fsf@ledu-giraud.fr> <837ctf575q.fsf@gnu.org> <87ilcypot3.fsf@ledu-giraud.fr> <83pm763y3r.fsf@gnu.org> <87h6si5aor.fsf@ledu-giraud.fr> <83a5ya3u16.fsf@gnu.org> <871qjm56ej.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16216"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63311@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 05 16:47:51 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 1qzfLq-0003zk-Rk for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Nov 2023 16:47:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzfLS-00060E-K2; Sun, 05 Nov 2023 10:47:26 -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 1qzfLR-000606-FH for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2023 10:47:25 -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 1qzfLR-0006eJ-76 for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2023 10:47:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qzfM1-00071X-NR for bug-gnu-emacs@gnu.org; Sun, 05 Nov 2023 10:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Nov 2023 15:48:01 +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.169919926226970 (code B ref 63311); Sun, 05 Nov 2023 15:48:01 +0000 Original-Received: (at 63311) by debbugs.gnu.org; 5 Nov 2023 15:47:42 +0000 Original-Received: from localhost ([127.0.0.1]:38029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzfLi-00070w-Fj for submit@debbugs.gnu.org; Sun, 05 Nov 2023 10:47:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzfLg-00070g-7C for 63311@debbugs.gnu.org; Sun, 05 Nov 2023 10:47:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzfKz-0006dZ-Dc; Sun, 05 Nov 2023 10:46:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9T0wNSidOMr5qIghXnFsNsnqfRTN4OAVd43zLNSWFFo=; b=D22PaDjqK6U9 R74NMtztrQDY/V2MFPP5NfgxlfiR0g2QdRZp//7wsQjoGvl6LVN0lGZ+ULsOhvFrABT/sJYfBvlJq Frs89x82Xhjz9ZGFr6nSfTUuDXv4mVjR9arz1/0JdXBcjaRI3i0jyFJLXv6u6b0fJr1z0bj4Fkp07 lgi3pW/20z0psZbEgJ46hleHgahn830QLkH6b1HESHH3WpZh1DmQ5awdrYfj7TZWOc4hvombLhhP+ hqYUOS6i7oLfTuA1D7y2JZNJMpdgApqhSvc/KyVw0d4NyAOo7v+YXsyyiQ7gwZbf6Ea7mkj2+ts6j uLj1bUn9X3I8YrgUsQ0ZNg==; In-Reply-To: <87ttq0nuq5.fsf@ledu-giraud.fr> (message from Manuel Giraud on Sun, 05 Nov 2023 15:24:50 +0100) 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:273829 Archived-At: > From: Manuel Giraud > Cc: 63311@debbugs.gnu.org > Date: Sun, 05 Nov 2023 15:24:50 +0100 > > Hi Eli, > > I'm still struggling with making 'smtpmail-send-it' async. As I'm using > message.el, I'm trying to make it work here. But message.el in written > in such way that it is quite hard to make it work with a threaded > 'smtpmail-send-it' call. > > And then, from a message buffer (with a quite large attachment), I've > just evaluted the following: (make-thread #'message-send)... and > everything went ok: > - Emacs is still responsive: I could switch to other > buffers, request the status of a VC handled file. > > - When the message is finally sent, the buffer is renamed > accordingly and tagged as sent via mail. > > So my question is this one: instead of making 'smtpmail-send-it' > threaded why not have a threaded version of toplevel commands (such as > 'message-send')? We could hopefully do the same for sendmail.el. Of > course, we should have it as opt-in behind customs > (message-send-in-background and/or mail-send-in-background?) > > As for when something goes wrong and we end up in an 'error' call, maybe > we should fix how 'error' behave inside a thread. What am I missing? Nothing, AFAIU. Instead of making smtpmail-send-it optionally working asynchronously, it should be perfectly valid to have a separate function called, say, message-send-asynchronously, which would work with background threads and implement the same protocol as the other MUA's send-it functions do.