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 ms1.migadu.com with LMTPS id GA9BBqnISWYPagAAe85BDQ:P1 (envelope-from ) for ; Sun, 19 May 2024 11:38:49 +0200 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 GA9BBqnISWYPagAAe85BDQ (envelope-from ) for ; Sun, 19 May 2024 11:38:49 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EfiecmJi; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716111529; 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=cSQ/sYaa6kT2kCh3lnK1+g4irNR5NaeRdlT7YuIgt3c=; b=Q7SiToZXTPqrj7Mstf7b7lwwGO5Umbew2fScY4lGJvikysi1I6nh9WOexvbKvtU64MNPh9 4iBO1VCg184cE31pUZ1kPiqPV33S1UGNV18GwzKzK7q8gE/oy8VpHJx8e4s72IYNKWn9ZR FaHqNrbNYcqSlHW6yFWOQqo5R3TnENOy+aCmoCPcARRBWrR6o0Fo1PClXVWg/723D4JkcY O5EG7fOzkCFCiwxuiikfdkmCRGIvVu07nSrsrMwmybg0dCMT+5vcUluSpYO5T/LrokQygL ufCRsJoV525ynPNKLO1Q9aydW5m07Yzib1v6W/XAYAtFy+iqDRumhjDLTHzB0g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=EfiecmJi; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716111529; a=rsa-sha256; cv=none; b=ob0C65uWH6OozkYIwk2azID2cX6LTw+IfA3ZxzjJyZnb0S37o8EtlBvKxoNkgcjXXLqeYE KmYTqvqUm7jv3hGy4m3V/y+i8lgXoYWAf464cP7PPs6LHk33hr3DUdA3oHMevvJf57uhVQ XbyO3mBdxEFQCzGFzrXmj+K71Q3DR8v0tSIMSevHeRCGfjTJCGpBJFY/xr0LRaNNbom2JU HUJ1MJL8tWlcN9DeFYvekMN7ww6XE5+qZzvsnPSvKExYty3uc3CBJfi0exhfK+pE1SfdQZ M+bBod/jtAtPQbbxODeHut1Z/ndwykFFLcJMAkVo1Y4PbcrjjZj9hBbc3YbiQw== 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 CC3BB6487F for ; Sun, 19 May 2024 11:38:48 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s8czJ-00015r-TQ; Sun, 19 May 2024 05:37:53 -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 1s8czH-00013v-CL for emacs-orgmode@gnu.org; Sun, 19 May 2024 05:37:51 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8czE-0003aK-Kc for emacs-orgmode@gnu.org; Sun, 19 May 2024 05:37:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D7C21240101 for ; Sun, 19 May 2024 11:37:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1716111455; bh=4WH3VxDZndXNJjIZAsJoJlSU35Zvv/WwC6IaLNDJWAg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=EfiecmJi7VVlkZgwCtNcF3Q+QSdChl56HsPzcU7qQhCObalnKWmxKrHsYvOp8rGLP HF3EHBG+9guIVuG99kcogc5OVJcVb69ABNQetI7dT+E/wOCc+KY/uubD80Z7q7vkAE LUT2mpN7/UEv1FJLOiVJPRNKH7B2S2Z2U+RMauPNvCGO/60LgjEzO075OS8aqTMfd7 J7WCTT5thKC2F+jp7fUzlGIUr4jy3UmmW8oPQgver/qQ+STgFbXnjvdfSnHNiWF1f6 /phb5Zs/vlgTIA2YyyzKB+YjtBwXysjI1P6DRPgsCs2PstDfSuly4RDgNFSuYwXQJw xawPWRRGpVSkg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VhwbM22FWz6tvn; Sun, 19 May 2024 11:37:35 +0200 (CEST) From: Ihor Radchenko To: Bruno Barbier Cc: emacs-orgmode , Jack Kamm , Matt Subject: Re: Pending contents in org documents (Re: Asynchronous blocks for everything (was Re: ...)) In-Reply-To: <6640f1aa.df0a0220.9356.9ce8@mx.google.com> References: <87o7d0mm54.fsf@localhost> <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> <65f95bf2.050a0220.6d051.c8b1@mx.google.com> <87plvpjj76.fsf@localhost> <65fc06c1.5d0a0220.0d53.efdc@mx.google.com> <87frwjlr1a.fsf@localhost> <6601b872.050a0220.31a67.5a55@mx.google.com> <87le63c3qy.fsf@localhost> <660ed63d.050a0220.36fdd.af23@mx.google.com> <87cyqwyvgw.fsf@localhost> <66225435.5d0a0220.f60e4.c590@mx.google.com> <87r0f02vq2.fsf@localhost> <6640f1aa.df0a0220.9356.9ce8@mx.google.com> Date: Sun, 19 May 2024 09:39:18 +0000 Message-ID: <8734qe5eex.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: -8.08 X-Spam-Score: -8.08 X-Migadu-Queue-Id: CC3BB6487F X-Migadu-Scanner: mx13.migadu.com X-TUID: yy4CN3AspPeT Bruno Barbier writes: > I've pushed the modification to my branch. Thanks! Let's work further on the top comment. > ;; To lock a region, you need to do something like this: I think "something like this" can be just dropped. > ;; 1. Call the function `org-pending' with the region to lock; use > ;; the ON-OUTCOME argument to tell Emacs how to update the > ;; region. Keep the returned REGLOCK (you'll need it to send > ;; updates). It would be nice to provide examples of `org-pending' call right in the top comment. Ideally, the example should also show how to modify REGLOCK fields to customize its behaviour. > ;; 2. Start "something" that computes the new content. That > ;; "something" may be a thread, a timer, a notification, a > ;; process, etc. That "something" must eventually send a > ;; :success or :failure message (using > ;; `org-pending-send-update'): Emacs will update the pending > ;; region (using your ON-OUTCOME) and unlock it; at this point > ;; the lock is "dead" (not live-p). Please also add information about sending updates to the REGLOCK, with examples. Otherwise, "receiving progress" in the next section is surprising. > ... (not live-p) Please name `org-pending-reglock-live-p' - it is more clear than forcing the readers search it themselves. > ;;;; Interface provided to the Emacs user > ;; > ;; The library makes locks visible to the user using text properties > ;; and/or overlays. It diplays and updates the status while the > ;; region is locked: the initial status is "scheduled", then, when It would be nice to name `org-pending-reglock-status' here and use the actual status values - :scheduled, :pending, :success, :failure. Ideally, in table/list explaining what happens with buffer text, overlays, and user interaction, when REGLOCK has each of the listed status values. > ;; receiving progress it becomes "pending" (with progress information > ;; if any). Emacs allows to diplay a description of the lock. From > ;; that description, the user may request to cancel that lock; see the > ;; field `user-cancel-function' of the REGLOCK object if you need to > ;; customize what to do on cancel. It is not very clear how user can interact with "description". Is it a tooltip? A window? Something else? Please give a bit more details. Also, when "cancel" is requested, it is a good idea to state that `user-cancel-function' is called and describe what it does by default. > ;; When receiving the outcome (success or failure), after unlocking > ;; the region, the library may leave information about the outcome "may"?? Or does it always leave the information (by default)? > ;; (using text properties/overlays). If that outcome information is > ;; (still) displayed, Emacs allows to display a description of that > ;; lock. From that description, the user may decide to "forget" that > ;; lock; "forgetting the lock" removes the outcome visual marks, and, Is "forgetting" customizeable like `user-cancel-function'? > ;; it allows Emacs to discard any information related to this lock. What does it mean? > ;; The description of a lock (live or dead) provides information like > ;; the schedule time, the duration, the outcome time, the result (in > ;; case of success), the error (in case of failure), etc. Customize > ;; the field `insert-details-function' of REGLOCK object to add your > ;; own information. Please show an example how to do it here. > ;; If the user kills a buffer, or, kills Emacs, some locks may have to > ;; be killed too be killed too. The library will ask the user to ^^^^^^^^^^^^^^^^^^^^^^^^^^^ typo > ;; confirm if an operation requires to kill some locks. See the field > ;; `before-kill-function' of REGLOCK object, if you need to do > ;; something before a lock is really killed. Again, an example would be helpful. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at