From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id QBxDKS9c+WXRIgEA62LTzQ:P1 (envelope-from ) for ; Tue, 19 Mar 2024 10:34:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id QBxDKS9c+WXRIgEA62LTzQ (envelope-from ) for ; Tue, 19 Mar 2024 10:34:39 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=V0+cDh1n; 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=1710840879; 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=PGtlh99LoQQJHiN5SVb5Ewm4mea7BRw06tlUGeFkuMM=; b=b71HhN+emwo86Dz3+yVwKiwlSusx9TwZ70LWShkGgvigERANn8fG6JXihsg9JNnaGDbHpe E9OvGyPnAk2iZNhYNOEpUpEVneZGATVsVyET6mR2lpRh3k7ohZbZZ8/2kyXho2NtBSx0C8 wH9V4btlvpnio8/yWUsytDbBWqRfrgFc7aaFF5Tn+pSwnSvVpF5hIzUJ5pizPNO0Mewzxl MKhaTUFmKcgaazisYRinHVox8age5THxtmS1Oh+3FxGs7R44N5kQwbimmVr2TN4i/5sDRy s1eSqweoykFHAt+DdF37KCdb/qWKNomA1XK49/7qyEXtgKRECM4tEI60EYgGYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=V0+cDh1n; 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=1710840879; a=rsa-sha256; cv=none; b=iWVV48L8T9LDnO7UTOaD1SfW2RnYGTS0u9yp5KhVhVieF4IbDOhYi3wZE+QVcARDXudMMx BCWT6HFdtqZNn4Qo7G1DQvAuq3XjUwEkieh+eiv/vWeRRt1lhE4mtBDGe+q8oCJqx1vB9X K1BuXNaCgdJ8YUun21zqqtXNWt3HfIn8b7VFXTG6nIlngr+tLU76O05VKiWoQiXYC+4lCf ite/cFSxhd71fzvUUhSiCdh/gosdSqCmn+IzFCDZ4dfmfZ3dG0Ot9YYu1byG31e7yaH4r+ yeCOjLmUQHfgwTYUhn9PiHriPv4pZDqAkPEGl7e8/PsOY1dxo9TMQzoaMrsjRw== 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 4FEF061E20 for ; Tue, 19 Mar 2024 10:34:39 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmVqq-0004Fh-Mi; Tue, 19 Mar 2024 05:33:44 -0400 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 1rmVqp-0004FV-FP for emacs-orgmode@gnu.org; Tue, 19 Mar 2024 05:33:43 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmVqn-0006nZ-Gb for emacs-orgmode@gnu.org; Tue, 19 Mar 2024 05:33:43 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-34005b5927eso1777681f8f.1 for ; Tue, 19 Mar 2024 02:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710840819; x=1711445619; 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=PGtlh99LoQQJHiN5SVb5Ewm4mea7BRw06tlUGeFkuMM=; b=V0+cDh1n/xeaayt8H0FTWC893zeEOwAkCJFbbNN7QGrBWLwXN3XNeEXc0mymsrzDLn H0fkblfg1qphhukHCxII28SB8ifO8/Nes9Ln4Us767t0X385RFirnQzgjmECKSGXD1VT t/0BpNaWNCH9GBVtjQlcvEDmB6CEJd27M2JIbMxnU8myYy6L8qpIrbik9yw+hl9RCu6A VipSPm0EYh/pf2Mavd256igIRF+2BU1If3eNqiKXcdybrxKAckxguzLKVseCkfHStIih O7EAehCxn1G5fNMRkbchmwyUq10g8UvShDEkVYmpjwafOga5YUABW94LbOZMHvNgRDDg /UxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710840819; x=1711445619; 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=PGtlh99LoQQJHiN5SVb5Ewm4mea7BRw06tlUGeFkuMM=; b=GkM/JhL6+8ZecGlrkm3PmTvZa4zna7vOAJa5fxzckRLhzSzcleYY5/U86oQ1RBgqPa sJpMYQUWMgFU3P+7q4TPWGbBoSQvwDeYKJ1KkC8tMpFNBzk+MBFoBw2Jj+5Ekz755DPh ZN5DsNeAL8lE4AXuDhE+sLnVWW7sM5TxLxUzYO2LViwa8mb/7g3yHeQP8oYev2uoTONg 9uaHqLo5a38eMIWQd4zapluaavtL5yA9sqFdzjOt40vJwDGOcVOOOS4656YoGQmrxQdt TOx7+wzGp6PaNsqtBGs776OrJjUmvDNlZf48t1hGgrEhmGNt8GxgqAV80KeeiAPa7wTf D5Jg== X-Gm-Message-State: AOJu0YwxVYR8JKU92wo5MJvVTU6uFNGnOrnbN+WOSh8rN84erxWt29u8 WDydQz2jTLpGGbO2NK+zFMW+EVFMKPl6J5U77xz5GGMf+soghWFO+VgdCcgx X-Google-Smtp-Source: AGHT+IHUlRXXH2JjnV4TD7x4hita7UTGpjR3zNKYbCOmTcyT9hxo1B4YRJ7agmxcIzdjhxu/thJe1Q== X-Received: by 2002:a5d:6183:0:b0:33e:cbf0:6dc1 with SMTP id j3-20020a5d6183000000b0033ecbf06dc1mr8953520wru.58.1710840819311; Tue, 19 Mar 2024 02:33:39 -0700 (PDT) Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e]) by smtp.gmail.com with ESMTPSA id t4-20020a0560001a4400b0033e756ed840sm11848673wry.47.2024.03.19.02.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 02:33:38 -0700 (PDT) Message-ID: <65f95bf2.050a0220.6d051.c8b1@mx.google.com> Received: by keynux (sSMTP sendmail emulation); Tue, 19 Mar 2024 10:33:36 +0100 From: Bruno Barbier To: Ihor Radchenko Cc: emacs-orgmode , Jack Kamm , Matt Subject: Re: Pending contents in org documents (Re: Asynchronous blocks for everything (was Re: ...)) In-Reply-To: <87frwuxy1b.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> <18dbe11968a.12c0800a31425096.5114791462107560324@excalamus.com> <65df0895.df0a0220.a68c8.0966@mx.google.com> <87edct0x2w.fsf@localhost> <65e30609.050a0220.89c06.1798@mx.google.com> <87a5ng7uoq.fsf@localhost> <65e9f49b.df0a0220.11103.1c10@mx.google.com> <87ttlhki9e.fsf@localhost> <65eb1e60.050a0220.337b2.a0f4@mx.google.com> <87frwuxy1b.fsf@localhost> Date: Tue, 19 Mar 2024 10:33:36 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=brubar.cs@gmail.com; helo=mail-wr1-x434.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.59 X-Spam-Score: -9.59 X-Migadu-Queue-Id: 4FEF061E20 X-TUID: 6KQ4C2viQgb/ Ihor Radchenko writes: > Bruno Barbier writes: >> Would "lisp/org-pending.el" be OK ? Or do you see a better place/name ? > > org-pending sounds fine. Maybe org-pending-text to be more explicit. I've picked: "org-pending"; it's shorter and can by used as a prefix. Thanks. > Similar to process API, your library provides means to interact with > process associated with the pending text - create them (40.4 Creating an > Asynchronous Process), handle feedback (40.9.2 Process Filter > Functions), handle on-done/fail/etc (40.10 Sentinels: Detecting Process > Status Changes), kill/cancel execution (40.5 Deleting Processes, 40.8 > Sending Signals to Processes), insert-log (strerr in Emacs processes) > list pending (40.6 Process Information), org-pending-on-kill-buffer > (40.11 Querying Before Exit), get information (`process-attributes', > 40.12 Accessing Other Processes) > > I simply went across 40 Processes section of Elisp manual and I see > parallels for pretty much every subsection; but the terminology _and > API_ are different. > I rewrote the API, rename many things, moved the code around and sorted everything into heading/subheading sections. This is hopefully less confusing and a lot simpler; and the documentation hopefully explains better how to use it. The updated section "Commentary", in org-pending, describes the 3 steps that are needed to mark and use a pending region: a PENREG (I've renamed "PINFO" to "PENREG", for PENding REGion, more specific). I tried to stick with the process terminology when relevant (mostly kill-query and sentinel). It doesn't really match the process API, but, now, it should be easier to understand why. >> I'm OK to rewrite it using a cl-defstruct (to be honnest, I just >> flipped a coin to decide between a struct or an alist :) ). > > I think that I need to elaborate. > It is not necessarily a matter of alist vs. struct, but more about the > API. I do not like the idea of mutating the alist entries directly. I'd > rather expose an API to work with "pending" as an opaque object - send > signals to it, get status, etc. > > struct is slightly better here because it automatically defines setters > and getters for all the slots without a need to write extra boilerplate > code. Done. Thanks! I added a function `org-pending-user-edit': it allows to edit a region using org-pending and `string-edit' (see org-pending.el). I also added an other execution engine (DEMO_ONLY), that allows to execute any elisp asynchronously, using callbacks (see `my-use-callbacks-schedule', in my-async-tests.el), and in my-async-tests.org, near the multithreading examples. To test, follow the org file [my-async-tests.org] (see direct link below). WDYT of this version ? Thanks! Bruno [I've forced push the new version, squashing everything into simple commits, if you need the old version, just ask and I'll push a copy there.] [my-async-tests.org]: https://framagit.org/brubar/org-mode-mirror/-/blob/bba-pending-contents/scratch/bba-pending-contents/my-async-tests.org?ref_type=heads [repo & branch]: https://framagit.org/brubar/org-mode-mirror/-/tree/bba-pending-contents?ref_type=heads bba-pending-contents