From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id KPAmL2ee2GULNAEAe85BDQ:P1 (envelope-from ) for ; Fri, 23 Feb 2024 14:32:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id KPAmL2ee2GULNAEAe85BDQ (envelope-from ) for ; Fri, 23 Feb 2024 14:32:23 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jqSJMSpG; 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=1708695143; 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=YyXVOo7ymfO/ZSsh2eKT3XNeMdGT6nFODj64gj1PYQs=; b=auPMt14uH6rRE1uaE3XTuiiu1J3dX6cJizCu7tpbrRsHAjyCiOZQZnnwMcGkinIRvJApYA YV/nzjc57m7+S916AIsu6FVamAZx/L7vja00+JFSoMPB9tV+EAzfzeJ/i2WHtFMul3aVzq QGKLLWW/CP4N3kVPZDNJSFa9fTzYC0qrNL5W17f2Tjcmj9S2ux1ujdb5AzenLbueTTwSMo Og2eRhr4flE3gM7Y4lRYIlrhtHpHzDnXptxq6FsiSCz4rLjGl/73XovXzLTCX+mtUAU5Kc sZEPC9oEl3pdRXFU4MnelTFGe+opBCcHMNhdapArkBFMdr+7DgZx+5D59wnluw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=jqSJMSpG; 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=1708695143; a=rsa-sha256; cv=none; b=gwlIor91Oqw3NtU3kjuODEf6wduqGZr+/bGIjFGUNT9oSgXas/5Sk2kmG+kthHHy65b//c JVm0VyXDCFLjPAwYFx+8H+Hd6hI353a8Rh0x0WGYX0kcO54DdXRlQCjjw5OZP/7ieb342n F1Tuqe0z1R1tWmSTdvht4Oc1dkwjuZwzYcLOWyx3PKYi73uflQyLnKBy010BwqVCv3upil k8hWK0hKyECWSMSjQPLkL6ktKhrGvCo0LLkGAF8ic5+sCuSQpOjVoI4c+/gq2OH6ryxkTh sUgTohSx0Z1pwuQ683hMDpP5Q7pcG6z3LQcGbX6Jp42Y+EbC0axb5OmEvcIqDQ== 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 76638693B8 for ; Fri, 23 Feb 2024 14:32:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdVeJ-0003Pz-0w; Fri, 23 Feb 2024 08:31:35 -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 1rdVXy-0004GA-Bh for emacs-orgmode@gnu.org; Fri, 23 Feb 2024 08:25:02 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdVXv-0003hA-VL for emacs-orgmode@gnu.org; Fri, 23 Feb 2024 08:25:01 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d21cdbc85bso13209411fa.2 for ; Fri, 23 Feb 2024 05:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708694698; x=1709299498; darn=gnu.org; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=YyXVOo7ymfO/ZSsh2eKT3XNeMdGT6nFODj64gj1PYQs=; b=jqSJMSpGRMHBzp+7I9TZgsvBUdgdLFwu429krbKHCbO90f4MQwl5e/X7VYEVVrHkOo pV4MhKozfGNruwppYC4iLsuzQVFD9aCA4lEqkQMmr8q8Yd96yXI3U5lQPLaHe6V2nmMR ijy+9V/qDBSwABQl3yoFfSIvP86unV0SI9u2tImm5YpB+e9HlE7yiuTQB6nToqXEDEpX 7mvjsucgLYzrqkqN66ZALEfSQY27eTBChbNjR0c2OLJi2wns9lQwZE9OdlVUc8i7C3cH UOTzVo9xaBgAgjjnnsl65Rxjj/dnSWgedWUfFVijX1ctlzd5FdTdx50L0iqUnbhNJIn8 rTQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708694698; x=1709299498; h=mime-version:date:references:in-reply-to:subject:cc:to:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YyXVOo7ymfO/ZSsh2eKT3XNeMdGT6nFODj64gj1PYQs=; b=XqIPmWnxcISP//cvCI0zdBOHp5vC47EvgD+kC9uYvwpwAjxiwLY/7S9+8luCrVtSyU 2N6YwAJnGGO4U2dYopfBPxzj/31mSrjw7w0byWHWdKQiMUtL0uNav0Y7o9grqxsoSYBm C7yHm5pcXrZ43wR2YRLKiI5BwzN5G0qig0WgM4CzQATcDEJUNZE0O98hjECcVIbBnEgf vmT4SPKC4rWv23MTYin0rs59ZvbYJrMH2MTzqpYgkYkWLzvZ65sHd/fxa+BU5hxFJvF7 XS1n00obPm64vnpvqzncZUfWHOwIR08IlBvTmpSd2KtGeNmqhXoP0gklAAnARikGfhEI s3Jw== X-Forwarded-Encrypted: i=1; AJvYcCXEX1RntPKTkwXuTp+iHw/uos8hD209YbSXbV+iiYwP+G/5BeniLDZ6iFUJ8bCH9GzRZSpB+ptq0e5wAY3ryir1Ae3QfqQ= X-Gm-Message-State: AOJu0Yyb4CxrqiXQYwN3m8/HQEriXdRvAqdhCUPWAkrvJ0J7iZEAlKDB RlevWQqZ+Ab4AiNqK3qnGjtDMCsZEBlvCP3WroWqy47wP1f3HMPq X-Google-Smtp-Source: AGHT+IERECePQOylrfp7LyWHDjQRF/sCl6/UlXjC9uX0p5oYq0VdBuNi35O/EsMly1FTOcW8yd0Xzg== X-Received: by 2002:a05:651c:1a07:b0:2d2:3c88:cd57 with SMTP id by7-20020a05651c1a0700b002d23c88cd57mr1590665ljb.32.1708694697605; Fri, 23 Feb 2024 05:24:57 -0800 (PST) Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e]) by smtp.gmail.com with ESMTPSA id m8-20020a05600c4f4800b00412157dc70bsm2489484wmq.30.2024.02.23.05.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:24:57 -0800 (PST) Message-ID: <65d89ca9.050a0220.757c8.6fdd@mx.google.com> Received: by keynux (sSMTP sendmail emulation); Fri, 23 Feb 2024 14:24:55 +0100 From: Bruno Barbier To: Ihor Radchenko Cc: Matt , Jack Kamm , emacs-orgmode Subject: Re: Asynchronous blocks for everything (was 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: <87jzmvjs7m.fsf@localhost> 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> <18dae5cab1d.bf1c7563863897.4896289306902277373@excalamus.com> <65cfa0d8.050a0220.cb569.ce34@mx.google.com> <87frxohlgo.fsf@localhost> <65d61ec7.050a0220.999f7.a39b@mx.google.com> <87jzmvjs7m.fsf@localhost> Date: Fri, 23 Feb 2024 14:24:55 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=brubar.cs@gmail.com; helo=mail-lj1-x234.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, MSGID_FROM_MTA_HEADER=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-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -6.14 X-Spam-Score: -6.14 X-Migadu-Queue-Id: 76638693B8 X-TUID: 819jJV4jCyA/ Ihor Radchenko writes: > Bruno Barbier writes: > >> Note that only the first 5 patchs are real patchs. The remaining things >> are just a demo how it could be used. The current async (ob-comint) >> depends on writing UUIDs in org files, and, that's why I couldn't use it >> as a demo. I'm thinking about dropping the patch: >> >> 'ob-core async: Add org-babel--async tools [2/5]' >> >> and just provide an other new keyword (feedbacks-with) so that anybody >> may plug its own feedback process. > > May you please clarify if adding the new code block parameter that > defines custom execute function is something you want to add to Org mode > or just a helper code to demo you main patch? Yes. (I thought about adding it in a separate request; but that would be simpler to include it.) >>> Or consider user running an src block, quickly editing it, and then >>> running again. What should we do then? Should we stop the first running >>> process? >> >> To keep things simple and generic, I would just forbid the user to >> reschedule the task until the previous outcome is available. > > This may not be as trivial as one might think. > Consider > > #+name: foo > #+begin_src bash :async yes > ... > #+end_src > > #+results: foo > > > Another code block with the same name will write results under > #+results: foo > #+name: foo > #+begin_src bash :async yes > ... > #+end_src > We can currently have multiple code blocks writing to the same place. > And async execution should not only check is the current src block is > scheduled, but also whether we are attempting to write to a place where > no other running block is scheduled to write. Today, the asynchronous execution is attached to the result; the source code itself is not locked and stays editable. With the current implementation, trying your example, the second execution fails with: Error running timer: (user-error "Cannot modify an area being updated") So, it's already OK I guess. I should improve the behavior (to fail before launching the second execution). But, the current design should work in that case. > >>> - on failure, Org babel sometimes uses ~org-babel-eval-error-notify~. How will it interact with asynchronous evaluation? What if we have multiple simultaneously arriving error notifications? >> >> In the asynchronous case, I've decided to leave the overlay in place >> in case of errors, with the error description. Clicking on that error >> pops up the same kind of popups as in the synchronous case. > > Error buffer does not necessarily appear on failure. When the code leads > to process writing to stderr, we also display error buffer. Even if the > process exits with 0 code. Got it. The current design adds the popup on failure; I should make it more flexible to allow to configure a popup on success too. > Also, your code currently creates overlays unconditionally. > However, when we have :results silent or :results none, Org babel must > not modify buffer. Yes. I'll fix it (and that one was in my TODO list :-)) But if the execution fails, I guess I'll need to provide some feedbacks anyway, but I don't know yet how (asynchronous popups are not an option, modifying the file neither). Thanks for your review and questions, Bruno > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at