From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#53877: 29.0.50; [PATCH] async Gnus/nnml Date: Thu, 10 Feb 2022 10:11:56 -0800 Message-ID: <87iltma8wj.fsf@ericabrahamsen.net> References: <87leyl1lr9.fsf@elite.giraud> <87bkzgpi9u.fsf@gnus.org> <87tud8cr5q.fsf@elite.giraud> <878rukmkpf.fsf@gnus.org> <87k0e4cojb.fsf@elite.giraud> <87v8xol3tr.fsf@gnus.org> <877da4cjdg.fsf@elite.giraud> <87o83gq9q5.fsf@ericabrahamsen.net> <87o83faybg.fsf@elite.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="32877"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 53877@debbugs.gnu.org, Lars Ingebrigtsen To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 10 20:58:36 2022 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 1nIFaO-0008QS-Kw for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 20:58:36 +0100 Original-Received: from localhost ([::1]:58776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIFaN-0001XX-B8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Feb 2022 14:58:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIDwF-0003c0-3Y for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 13:13:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIDwE-000124-Q1 for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 13:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIDwE-0004yo-F4 for bug-gnu-emacs@gnu.org; Thu, 10 Feb 2022 13:13:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87leyl1lr9.fsf@elite.giraud> Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Feb 2022 18:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53877 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 53877-submit@debbugs.gnu.org id=B53877.164451672619059 (code B ref 53877); Thu, 10 Feb 2022 18:13:02 +0000 Original-Received: (at 53877) by debbugs.gnu.org; 10 Feb 2022 18:12:06 +0000 Original-Received: from localhost ([127.0.0.1]:57072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIDvJ-0004xL-V9 for submit@debbugs.gnu.org; Thu, 10 Feb 2022 13:12:06 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:45614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIDvH-0004wp-Uc for 53877@debbugs.gnu.org; Thu, 10 Feb 2022 13:12:04 -0500 Original-Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id C0B87FA08F; Thu, 10 Feb 2022 18:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1644516718; bh=xIGQPG4J24jTsw71NlLdU3ri3blVNDj4Rtg4evA/Kys=; h=From:To:Cc:Subject:References:Date:From; b=A2qrFEduVS32wNnKtacTUp4wmt/45LsQR8X30exV4t/wNeBhNanVtstmfxANPyDA/ h0rWKcZizFjGOMJREVOS9mF4/hLN/4g+0bRfT2gPXCparDwipk3PLQiJoQyOp702V1 4MQd3TXy60dfYo7OElW/HgWcOCScOsiyu7trYQ08= 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" Xref: news.gmane.io gmane.emacs.bugs:226626 Archived-At: On 02/10/22 10:02 AM, Manuel Giraud wrote: > Eric Abrahamsen writes: > >> Manuel Giraud writes: >> >>> Lars Ingebrigtsen writes: >>> >>>> Why can't you bind `nnmail-article-buffer' before calling the splitting >>>> function? >>> >>> I spoke too quickly. The idea was that with a temporay buffer I could >>> run multiple splitting in "parallel". But rebinding just *one* global >>> variable won't help much here. >> >> Are you sure? AFAIK this was Dick Chiang's approach to threading >> server updates: let-binding the value of `nntp-server-buffer' within >> the thread function. As far as I know it worked okay. The splitting >> function and code run within it will have a separate value of >> `nnmail-article-buffer'. > > I'm trying another approach: seek to the processes in the backend, don't > wait for them to end but instead attach sentinels for what's left to > do. Maybe it is not the best approach because Gnus seems to be heavily > stateful/serial. > > I'm not sure about binding in sentinels: do you think it would work as > binding in threads? Are you sure the original approach won't work? If you set `nnmail-article-buffer' locally within the thread function, it seems to work okay. Is this not workable: (defun test-threads-outer () (dolist (label (list "one" "two" "three")) (make-thread (lambda () (test-threads-inner label)) label))) (defun test-threads-inner (label) (let ((nnmail-article-buffer (format "nnmail-incoming-%s" label))) (with-current-buffer (get-buffer-create nnmail-article-buffer) (insert label)))) That creates three separate buffers, named correctly, and holding the correct text.