From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wJbzCpfuBGIhgQEAgWs5BA (envelope-from ) for ; Thu, 10 Feb 2022 11:53:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CLOrB5fuBGJuTQEAauVa8A (envelope-from ) for ; Thu, 10 Feb 2022 11:53:11 +0100 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 878D5116B9 for ; Thu, 10 Feb 2022 11:53:10 +0100 (CET) Received: from localhost ([::1]:49200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nI74X-0001XC-Ky for larch@yhetil.org; Thu, 10 Feb 2022 05:53:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI72c-0001W9-Rx for emacs-orgmode@gnu.org; Thu, 10 Feb 2022 05:51:11 -0500 Received: from mail-oln040092068012.outbound.protection.outlook.com ([40.92.68.12]:4990 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nI72Z-0000fK-90 for emacs-orgmode@gnu.org; Thu, 10 Feb 2022 05:51:10 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HtY95XuOfIGvbDPWHjYCVBOn4cZsrXNUE2OwNjUiK7jmmTDgLYECRSjSMWO1s6XLL7MhIIzUc/kx9zX+JJ7zPd3Irz9E5mJt/nI5PBSBJUmKEYyoerJCzOfWg5CvakrW/MXSBzxITuY9PRxY6x6Khaeq90HioCwREZI2WN9f0P6uhYJHf1d8DPS05bXYRke3wrMGRf78fzbO57+1uDUw7E7TkWMatasIYJ/Cxa4OXtCa1kqUyiEwYlxdP/TN0JVsk6Lv5PFMcr9iUg6f/Q2JuRXfUNX+OLBHUbjAEiWs3vWdNIAYO6yvSYPXoW9FxMkdghojM6Zcojb5J3DM5uJ8wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8tqCFFhg2J9s3Q+yF6SVJf2Sp1BzyKVfJ7Tm+D1nFuI=; b=JwSwkIQqyZf0pSHDvv8Onci/puIJhqvbLWWBBgWRmyRxCO1YkMFeWuLs3gATUPhAV7eSsczfCczcngS0DKEgQ1FAtjcqmiTDIznbDZEoiDuUI/1E1E2Iqxg46dwCmy8AUZPRGXA7USJnGoMrLKbm9VbTKsdniVfACDZG8XAxyJdS+BC5CbQnudepJRzJAaDf05xcbErO7damy3YQGxMxKWk3BMXuLST13SuPXV0X6k2ZwmzIoOmgPjOWJtarAgylmImrEKbYMlanbahuf7ZpXvMXwVRk/4wn0kNggcGUvqRKoJyBYgVWahjC5gverXqN8P8SDLokR3ENILGd9ZXYgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8tqCFFhg2J9s3Q+yF6SVJf2Sp1BzyKVfJ7Tm+D1nFuI=; b=f7fJfoQxaUa1JXzyii7wH++XiZrOxbkydcgfEqVmd619eI62zy1iXg8MK6wCSu1BWPuGlAVPLrXyaORt9ZLvphXPCgggF39NRPOU9S8DMFxqDWWSD8DDuKMh2g1JOMKbe1WiNUwqyVimI8pwhlZRiMYw1ZOPfyck4qRVEXdgZU+8z7SOxZm6bDlPTI9dgXrASrvMQki9NYaUUurzm++KZ0ppxe2Wf1dGIMbNPgl0rRpIzQk3cbHs/rEdCLSzAMmndbnUhvtXFKc0CTcYwQ3TLR4qXENBYxCdPVX9v7JZuuYL6bnT4RfOc5Nbs6Pgis3zE9c4pBghgjj3MUbtcAVjIg== Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by AM0PR0602MB3553.eurprd06.prod.outlook.com (2603:10a6:208:23::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 10:50:47 +0000 Received: from PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::50de:9162:7856:2782]) by PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::50de:9162:7856:2782%6]) with mapi id 15.20.4975.012; Thu, 10 Feb 2022 10:50:47 +0000 User-agent: mu4e 1.6.10; emacs 27.2 From: Ignacio Casso To: emacs-orgmode@gnu.org Subject: [BUG] org-capture is not reentrant [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)] Date: Thu, 10 Feb 2022 11:25:18 +0100 Message-ID: Content-Type: text/plain X-TMN: [5aZ7lu96Sb42dl6G4DVBjmsZR1y03gc2] X-ClientProxiedBy: MR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:1::33) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87zgmzgflq.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9221ec40-cd43-46ae-bef5-08d9ec833224 X-MS-TrafficTypeDiagnostic: AM0PR0602MB3553:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4dG3h6a+pn8IpHXwyQk4y+P8o9mrLiEsFuSvvAesCh4QUjEQgbJv/1sIifLjJzdybDVSh1CVbNV0p4n8J2N9hUMzjrMTLJhre1+5LMmErMq3XNtR7xpBc/qvyObxqBHYWF+PgzzfxoDUOurF5a14B/FiWfgaxmn5xnfyOeu7gw+bpiw6nboQ+ad3cV50B1bMmM3+UQi7eRRaAOj6HUYjGceBlguJ2OiaKB31anntyDP3QSS+vBCPQzxrLqEGx8sbhHICFdB+GrojZgZcEIuBMLExP1zdjJdWDYEAkThNifOKmGbi9D7zGXot/RTgeh4/Y20sc4/wOioalKXWCQvAnSHRMqQ7OSqgMXsdweAKeGQms2MrgvCMePBy1ElAsN8PYWg7l4mccMscSbZ6CPO+T3ZFR6J2nXUpQ8POzcuKxOnM8W4qcogKL5J1v74vtLBcOqeEAUAcaBZMO8UiXLjTWtSvZtoO47/RNsbI0cbfwTO4ZixcvB14JQtTImv2gt7pwVyGMNS5QbzN/Mzt8/X9E9WlrMZU3NDfl6qmon2q1OIgljnWx8TCRzSolluXsC9HxzwIAqEzuxqnK54CY1W9Yg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LBtbODxytGa+TjG5HcjCTIaemd6Jq56M6JEbPPShJgAGikprraYUr1/VRgZl?= =?us-ascii?Q?iz7+u/7UdyX3swrgSBPxorqyit6ktbVqjcAitsCX1R9O29Z8FdTC9jGM5TfQ?= =?us-ascii?Q?x1WsJ/eu9BV391f3nO44iAs03ZbCLPNPWDbMWb9wKr9Haq/v163jKRWkqBZW?= =?us-ascii?Q?k7QAs135feHAlEkJKyNBLeZwsuce1dx0V7SsFSKaLeM8QMFTrLAhwkXtrDdr?= =?us-ascii?Q?o4EjYIxRexeRok94K4y8PvUlKAvVkBug3jmxpBBaiakZjZdB7ej7JXO85KRO?= =?us-ascii?Q?vnN0awaN6yUPD5eoK3qZAZZbswKkJUmqi51RYK/DuRz/H63y/AAb9hUIK65T?= =?us-ascii?Q?0+bQnRiJdBmJrV/ePI0iLikBYuxlMfMwdhJAJA6nE8Gk99zzUrjUDMzE2BXa?= =?us-ascii?Q?DyygttJPIApIEGt/MIwqx+FkT+iJ60Ya68u7XSwpurvUWSHwL406jLcrTL1f?= =?us-ascii?Q?TNeF8cNNU1KSqJWFk2LzjJJyvSnZVSRl9L9VGl5uljS5NmxHQW356U+vXtlH?= =?us-ascii?Q?6ChURu7ySRJVHBkPqXfxJMNG+gIqxMbJOYPqMtFJQzciq1Z42lQ8frznqCVN?= =?us-ascii?Q?Z5HS8WA+tw91dKTqahaV0NSVa9i9k3Ju+VGW7I1vRqQx1GSlFKgT7u7QFRfX?= =?us-ascii?Q?cJOn6f7ZYmTmQa0AxTV2J7N31jAU1oGX9caV6wvZJTIdIrfhpe5Rsg6W4jkC?= =?us-ascii?Q?yRCzAWSbCxHr5yySo4WlPy4vj6fxRHdNp8d+Rw5GjZsjBnKaiWjHulroehQo?= =?us-ascii?Q?CaAzZGASGpg31D+Wa3fugbaQnh1nUaJgkWhDgWtzDCK9FG0TWCFYkOEWoiMQ?= =?us-ascii?Q?Ll3EJbAfHZOZUSqqy5s+pbKrZMdGwGOpnOOs5Y5DIuTvExn0lTrQSslLoknQ?= =?us-ascii?Q?R6ew92iCLZrADB0EgbZo2ZLZ5apCy5y3a2BEj6jlIRoUdT+hVaoBQ2Kf7ZBB?= =?us-ascii?Q?7yjUQro4k+Zbyaa8f1XNMw=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 9221ec40-cd43-46ae-bef5-08d9ec833224 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 10:50:47.7962 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0602MB3553 Received-SPF: pass client-ip=40.92.68.12; envelope-from=ignaciocasso@hotmail.com; helo=EUR02-HE1-obe.outbound.protection.outlook.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644490390; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=8tqCFFhg2J9s3Q+yF6SVJf2Sp1BzyKVfJ7Tm+D1nFuI=; b=bo1912U2B2QGQ2j4efIfudDomVE9065kBPTDYwBzY5oBCiDVLvZN64iAxU4QP/kqYdL3IC Bd7td6bQ04Aqb3J7PX2NCuy/7WqPIRliXTY4Ol31B3QevRTFq8A8hM4dEGY0hQY5f+Qlcm dUbcxnEA2rLA/UySklCwD7VgwpLnl+fUe4Xvdey7fO0hy9hvq8WyexuxIZOKQImYT2X6uR 4izVAv14rzfr2P5R/Wpy015ARn2BNgzSkyo6wn8SK+UfRt+WN9IzBx7H2Z78EUgNjMEJJH jvhYy/Z3SyB1J96yconHcBn7NZzk5VfPIT23Id3QPIFF6ld14io6rJThh55X4g== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1644490390; a=rsa-sha256; cv=pass; b=d8q72QwGarbQEc7vEuxUv8m1ZzBnzvCBSbV4CqCObq6VmQHoOTVc+9KdyjR7jph6JW7mQ9 XDyO1qEGg2favVPhcb0xuQvRq7PPMBkywQsqB+SDSlgmh/P52OIRjUITm8Nmrxq0fw3pPS Ry1lnEeh3T5TcxCe0QE5WbEfq26TqvMOJ2XNiUtlnDGsfoX3z5gAyP7ceQ4SBi6Qm2tDzx tpyVmlsXigEtV5WnM2yFKOgfJfBlLlovmxlirwtKxlxsx715J5sYx8ZlH5+C53HIJheUC3 BQBVjIk/ftkGikGQzWDUN+34N9BKK7tY+6ccTnNx5x49LZzfFp2oU8AyHthG3w== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=f7fJfoQx; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.com; 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: -5.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=f7fJfoQx; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.com; 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: 878D5116B9 X-Spam-Score: -5.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: HZ4yEVeepfQ+ Hello, I recently tried to use (org-capture '(4) key) (i.e., C-u prefix argument GOTO, so not actually capturing anything, just moving to the target) as part of the function passed as target for another capture template, using file+function, as in the example below: (setq org-capture-templates '(("i" "Inner" entry (file+headline "/tmp/foo.org" "Target") "* Wrong Heading" :immediate-finish t) ("o" "Outer" entry (file+function "/tmp/foo.org" capture-target) ;; "* It works!!" :immediate-finish t))) (defun capture-target () (org-capture '(4) "i")) (org-capture nil "o") The result was: * Target ** Wrong heading So it worked for moving point to the desired target, but it overwrote other parts of the template. 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. 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). Regards, Ignacio Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20) of 2022-01-16 Package: Org mode version 9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)