From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cHu3Od1IxGWTywAAe85BDQ:P1 (envelope-from ) for ; Thu, 08 Feb 2024 04:22:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id cHu3Od1IxGWTywAAe85BDQ (envelope-from ) for ; Thu, 08 Feb 2024 04:22:06 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kyellZlQ; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1707362525; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KMygT4OF3fXgT6A3KeefmGCw0qwrHndWKgk4U9S6Lbg=; b=ExeTQXmUtvexNeuiNYewVocNqCuDC4jDgdB9qhr9ZFphd7WYT2PNSbO9wsOuCIHkwBreB5 m6cnor2hg3yA7s1gZzicUoZArnhdCXRixvIyOe6/7V2otNMyugWP2UpOVf2xrVy7LNjHQi RjdSsQJ0PehH1SAwWZewzuqOm0h6CiTxR9B8owHECrBkyf0COgghyRUKZlw/NznZ3ii5k5 lb1VAIZ0pG6gLi0pVZ/qIEx6DSdZetUJjIzbHjLEuBbvN+17FfIzrgzdSBRL3er2MAOuV/ gIeWtlRnsmc5EyCdxlZiB0McYPX2i4vYXL2K6q2BhXGo0LiOZh4D+DxWFfrh+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kyellZlQ; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1707362525; a=rsa-sha256; cv=none; b=KXLFNuB45XaqBmdsh2czxVdtnPor0NtsE4PATMULIGUVeZRMpkS3eJUcaY8IDxaKdME9HD F0kote5PGtb3QA+/KCLHQmmkQ9GNQJ1DzW2/+KKcUTiPZ1jqG2FqpoZ7bj1UurzgxDayZn a0eRiDAdoNz9Y8KVZsbL2mULTozNLBdluMCPRFkzOEEP170dnWRNioowxe5kKWhMdhXp36 sYdyRLCbpi481JIqR3N1d2KJxQIFRSKTQABdd6LXytRE8rFB0KGCobQAZ2zEpzjUJkxMnv jDy0kArjm96nOIpBLNjKBihpbmYIvbgXiAFuYXxKB5WxpFYYXLHk87WF/rW2rw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BFA0F57E5B for ; Thu, 8 Feb 2024 04:22:05 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rXuyP-0003GD-0w; Wed, 07 Feb 2024 22:21:13 -0500 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 1rXuyN-0003Fv-H0 for emacs-orgmode@gnu.org; Wed, 07 Feb 2024 22:21:11 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rXuyJ-0006QC-Jl for emacs-orgmode@gnu.org; Wed, 07 Feb 2024 22:21:11 -0500 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso1029458a12.2 for ; Wed, 07 Feb 2024 19:21:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707362466; x=1707967266; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=KMygT4OF3fXgT6A3KeefmGCw0qwrHndWKgk4U9S6Lbg=; b=kyellZlQbXOZU3zGT69JcFmQZRoSJXxfngpnFzED0rktfVgcRBZyk4BaFNHeGWkprG 3Frmc0zHLTaqz2SJkFkxzmxwTMiVC7VUqVH43+8NKUOiBEW5iZ1oKN0S2MF74oKUzGaK cP1YFDTGPaTqCm0srBwrbohzPoDtA/+fW322JfbG4rNaZlhik9fzPQQsermcrcLs6HDs ja/0GLNKVHs0eC9X/B72gJwAs2KgfGXpk8iJG8NYmxWGy8l47F9cxwjelyCxy3BFQbO0 bKWtxyHEW4cgyRemWqzzAtMkF4suOtvlG4aupx5pB+FEqN9yVqh79zmyqijHlswMLeIF nF1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707362466; x=1707967266; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KMygT4OF3fXgT6A3KeefmGCw0qwrHndWKgk4U9S6Lbg=; b=qRNt0o01i5+mhxAG8F9rUT+q/iZqAF5UJz1oVaDM8Uc3k72NkVhl66A6LZWFz2WH+h yoM94n5DdY0HMIVj92Df/tetxHeb1SGf/uMfBBbjCVpDkHtiYuL1zKk9thn4aR6RKTUz zMtU/E2Vr/hSQAbiAgqIPuFo7l4AmT1kBLy8ghRqbBh2h/oFNELr7xe8SPPmuVDQophN RUXAMW3P1LNk8S8XMjxf9zUKPxf01sFdJIzCt/WkMz7/AKIiELUIT2BXZCYoqAcOn1C4 FdKPZvG7EHvIfCbsM9UqchLV0TKPhzvfZ1DRrT+pApPkrIEs+o7W1ePpVj+KvEDEh5Y3 gaxQ== X-Gm-Message-State: AOJu0YwUVHe1jcswmNOs/HTOuvZVRqGVLmyRL5e6yFveO56omWTl0xW+ +MkFMSG+sGzk2KqVJIKMfqbpBMbhXm4jDMztOH6ZSLHTf+iX+xWz X-Google-Smtp-Source: AGHT+IHZweYcsPzxIosSmvC6KNEz7gI7Q3iAeYeACycBplIDtnAOuxcwBeYCAH9UwQaUWogZLv5TiA== X-Received: by 2002:a05:6a21:920c:b0:19e:99ee:8618 with SMTP id tl12-20020a056a21920c00b0019e99ee8618mr8331496pzb.15.1707362465750; Wed, 07 Feb 2024 19:21:05 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVscxt3IyB6f0Yji/LjVFF8uz8QJqYK27eHP+8BFhysCUPmRUtJvTKFLqnIrD6AC+Mb1RTlOjPsb2k56MIBIVRyYPc6 Received: from localhost (157-131-78-143.fiber.dynamic.sonic.net. [157.131.78.143]) by smtp.gmail.com with ESMTPSA id r1-20020a170903410100b001d8f81ecebesm2216803pld.192.2024.02.07.19.21.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 19:21:05 -0800 (PST) From: Jack Kamm To: Bruno Barbier , Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Unexpected result when evaluating python src block asynchronously [9.7-pre (release_9.6.17-1131-gc9ed03.dirty @ /home/yantar92/.emacs.d/straight/build/org/)] In-Reply-To: <65c2875f.050a0220.caf6d.8291@mx.google.com> References: <87o7d0mm54.fsf@localhost> <65bbb108.050a0220.b60fd.6790@mx.google.com> <87jznm8hcu.fsf@gmail.com> <875xz42rp9.fsf@localhost> <874jen8zec.fsf@gmail.com> <87o7cv9e80.fsf@localhost> <65c2875f.050a0220.caf6d.8291@mx.google.com> Date: Wed, 07 Feb 2024 19:21:04 -0800 Message-ID: <87sf237ian.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=jackkamm@gmail.com; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.99 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -6.99 X-Migadu-Queue-Id: BFA0F57E5B X-TUID: dGwaRf0hW+47 Bruno Barbier writes: > FWIW, I've been trying to use asynchronous blocks for everything, not > only the source blocks that are based on the comint mode. I think it > would be good if ob-core itself could provide an asynchronous API. I've > modified my Org so that it does have such an API. This is work in > progress; let me describe it. > > I've modified ob-core itself to allow asynchronicity. In the > asynchrosous case, instead of calling: > > (org-babel-execute:LANG body params) > > I'm calling: > > (org-babel-schedule:LANG body params handle-result) > > where `org-babel-schedule:LANG' is in charge of calling `handle-result' > with the result (or the error) when it is known; `handle-result' takes > care to call `org-babel-insert-result' at the correct place (and > `org-babel-insert-result' is only called with a real result). Sounds interesting, a couple questions: 1. Which languages have you implemented/tested this on? 2. Does it apply for sessions, nonsessions, or both? > While the execution is pending, I'm using the same technique that Org is > using when a source block is being edited: the result is left untouched, > but below an overlay. The overlay is used to know where to insert the > result and to display the status/progress of the execution. If the file > is closed and the execution fails, nothing is lost, the old result is > still available. Also interesting, I think it's worth exploring/testing this overlay idea out. Does that mean that output is asynchronously printing into the Org buffer? It sounds cool but I wonder if it might cause problems while trying to edit another part of the buffer.