From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kKMBDFDCUGNxhgAAbAwnHQ (envelope-from ) for ; Thu, 20 Oct 2022 05:36:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qNLAClDCUGPBYwAAG6o9tA (envelope-from ) for ; Thu, 20 Oct 2022 05:36:48 +0200 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 D310C14A5 for ; Thu, 20 Oct 2022 05:36:47 +0200 (CEST) Received: from localhost ([::1]:55666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olMMQ-0006MO-W7 for larch@yhetil.org; Wed, 19 Oct 2022 23:36:47 -0400 Received: from [::1] (port=38052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1olMMQ-0004tC-S7 for larch@yhetil.org; Wed, 19 Oct 2022 23:36:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olMKc-0004ra-5m for emacs-orgmode@gnu.org; Wed, 19 Oct 2022 23:34:55 -0400 Received: from mout02.posteo.de ([185.67.36.66]:47269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olMKZ-0006YD-Un for emacs-orgmode@gnu.org; Wed, 19 Oct 2022 23:34:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DBFBB240101 for ; Thu, 20 Oct 2022 05:34:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666236889; bh=rtRA9xEe4WM6rMHLJ/rw7geqtgJKMzqqJHCR2bAd6Xk=; h=From:To:Cc:Subject:Date:From; b=GRzhOxlwJdS0QB5UlCy4jAZTDB66eLp/0brEI3fnkKNGmNIJWxKWsqdvniRSzcvf2 68Jzd7EMGeBycdBGXBS9QAMAJ/i6aZ8ClCkPdOwKz+cPoZ4sx8nS77kRqubMigCuum 0SqLh9Ntif/IT66r+VNH6vgeIWk4aYkmL5N2NlQnAua9u4FsGoisnj8fd1Z8fIZsh5 fwYCTwz+7CeiMFYXVvw4h7phesd9KdAnKjEYqowNmsoBR6AuJnnRfJErk3Luf5kuyt KTyqrGxGXgIEA/3HzR8IAsPB2R+VBBSzd/3Ig56jNKsNQ4mw4BKboZaDRbTh/GBOnu kB66NymjwpavA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MtCs10cgWz9rxM; Thu, 20 Oct 2022 05:34:44 +0200 (CEST) From: Ihor Radchenko To: Ignacio Casso Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] org-capture is not reentrant [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)] In-Reply-To: References: Date: Thu, 20 Oct 2022 03:35:30 +0000 Message-ID: <87v8of9ngd.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: -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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666237007; 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=jdimcYNYtuy9kgM3Hk+XcuFbOhOFTU5umf+QbfLt0J0=; b=G5C0XRYK7qYewzJiY34r+iwB+PlzOk5605cSa4t59nWLw4IgXGLKNvCB/xZEeZkb1iLILK WN4h0iUk3l54Dn3zixNAA6/zPNLXacCAp8Lpujqe0Fw4KxpETijPfcjk3DkIUcI6cO4GF/ 1LoTGOnj/DEeNF0Eugty+gs1OysNMDcAq13x/GzjcE4g7+B7ehELyEVl5zbW1AeyuZ3uQM +ykUFehfaWrZcreoUpM0l6aY7KAoovrvzaDywQrPvg4S9KHMlQKy1CPmkX2yT/Oqw7pVPl Z9Thv3Qx+JooSknptoqffMreDac+9blggUB0Bl9ouyPpjWAfoo7OMMCHoYVS3Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666237007; a=rsa-sha256; cv=none; b=oZ1tp2j+K5o38vrcyhB0QedCM2lO3nfP3AuyHbdezG24hUMlwpaTdER7S/SEXjPLDEwyw8 ahN6atfsNvhIuUm/CPtLi74M4F562sKweZ2dYOWgO/ydLW4gAObiNvD4bz2T4txaKcJff1 jI/xoG7ANbzpytyuODPX1jQBAfORFMoY6w/Kz/KCkIpvcFUPscrBgdTw4K3FgPFEuhSt2e CcxRUATVN1nkWxm2+TE0w8Ic5/FmYVmNPoVqGEAmuAteVcJe3IO9S9xqQAL9CcxH/QC6xP vNuus62rYgkYk8wUL/Lzmt2tayilru0EfEKT1V+Malh97FxSMMv6zyl7YnL9Bw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GRzhOxlw; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Spam-Score: -3.22 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=GRzhOxlw; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Queue-Id: D310C14A5 X-Spam-Score: -3.22 X-Migadu-Scanner: scn0.migadu.com X-TUID: DwgyooqWECks Ignacio Casso writes: > ... I took a quick look at the code and it > seems that a global property list is used internally for the capture > process, which seems to be only initialized at the start of the capture > process and therefore the inner capture would overwrite it in our > case. I saw also that the global property list is copied to a buffer > local property list for the case of starting a new capture process > before typing C-c C-c in the indirect capture buffer. Confirmed. Your understanding is correct. Capture inside capture is not supported because of the internal capture code design. > Do you think it would be easy to recycle that code to also have a stack > of property lists and allow reentrancy? Would yo consider it useful? I > would, but not really worth it to implement unless it's a low hanging > fruit. If it is, I'd volunteer to do so (although my elisp-fu may be a > little bit lacking yet). It will be definitely useful. We have bugs surfaced from time to time because of nested captures. However, one will need to check the logic inside org-capture first and identify how to switch from global variables holding the capture state to something more robust. A good first step could be looking through org-capture code and the functions it calls and supplying comments to places in the code that are not immediately clear. Such comments would be useful for others as well. We can also help in the process, if you volunteer. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at