From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2GpxBfOuMGJDEAAAgWs5BA (envelope-from ) for ; Tue, 15 Mar 2022 16:21:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2JkTAvOuMGJ7UwAAauVa8A (envelope-from ) for ; Tue, 15 Mar 2022 16:21:23 +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 88EB32CB40 for ; Tue, 15 Mar 2022 16:21:22 +0100 (CET) Received: from localhost ([::1]:55146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU8zB-00026p-19 for larch@yhetil.org; Tue, 15 Mar 2022 11:21:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU8y7-000265-GN for emacs-orgmode@gnu.org; Tue, 15 Mar 2022 11:20:15 -0400 Received: from mail-oln040092074035.outbound.protection.outlook.com ([40.92.74.35]:53182 helo=EUR04-DB3-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 1nU8y4-0007vV-Ib for emacs-orgmode@gnu.org; Tue, 15 Mar 2022 11:20:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iaz+3UHSAf/TPPlMIGk+fmFwMFFZjID6uLL7lcxMwrXmwAJkBEIR7zGaAA0A4+Up819k7eUKmDpRhVbh8t/5/2jiUt3TnlC+lfiohs68xO/6Fwyy8Wa+G7elcZIUYkinHe6VxsR6xLc0lXWygZqls0pjf3vbIMNZqjNPTSWwrgQtqzeKVDdghJ0Wrbsv/7Hwto1HUI38M5I9f7XmchVjVQKCWHyYOd9sP8j/4b8BFC6h4vd5NACyGWPsK9zhbAPIMPDQJAEHpCbb55gOrKwaMJAKvsyzgp9FzKWQgGqE4Y8lKQ+6NNM1ffpqWXiLLLETUtxWnFKs/TshajVdsEBQ9Q== 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=XpplAhx4eUt6ImEsvaHetsTvgMMInE3dA+1jL89E3jk=; b=eMKut7Y0NEjdPKvYmE8ZBquXoRjIs0AcbcUWFbjoqnL7J6NIXW+hvlOisAu8frtw0cLuX1icIvAGzsD32qKy1aoKutWqMlocETfU/Pyd7PWAFl8bKnS/jZU1pkv6aQoM6LY/4PfgENzHLXTeOkU584gOAbvfgh1BFN4ZJLrtq9zzhUEwkb4PbH56hJqDOLAEvuUnGzObLm86oMZ0B61D40Qe7wVDD7YNKeGnP1elkIhKYgMbc1WAplcD+Sm9q1uo0BwFYt2fki1dXViZTN7Whd0kqENqD0MOAZI/BPh+ml3EytNNYy72phP289ruc4dMAhks0pjMtA0M2y6tLdt+RA== 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=XpplAhx4eUt6ImEsvaHetsTvgMMInE3dA+1jL89E3jk=; b=d7Izc/gx8cvWf+0GTLlnGTfZLbB2C+hrgdXOGarFvuzTj7peOvOVTRpVX6KPDhDf0vv32ZyGWK4yMcqZCL+YDcsLL/96sTRdP7pcSqXMipmO8kxWPlZWcMo3mlI8lqJhXg7onJPqVKgZe5zpBNMCPzkGRYVV59JOP5ngyeCHnRYTS5wBtvnCBe24xYAHhWrOrB9RhZ4J27zCFmqfJiDdCpI6hppWjwCA5aIM7C5OZdQXP9554whhbs2aA/bRBaE62uKXcDP+nQ0YyvCxZizn8CFs03xCuSRTNAnaQiHSwJsCWrH5tSi6V4kPpIUdZcmrqbM9vr8BK1WqKXXjsSe8JA== Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by HE1PR0601MB2154.eurprd06.prod.outlook.com (2603:10a6:3:29::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.26; Tue, 15 Mar 2022 15:20:09 +0000 Received: from PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::e05a:8d81:8648:b10f]) by PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::e05a:8d81:8648:b10f%9]) with mapi id 15.20.5061.028; Tue, 15 Mar 2022 15:20:08 +0000 References: <87mthw8b74.fsf@gmail.com> <87tuc0mjjj.fsf@gmail.com> <87pmmom9br.fsf@gmail.com> User-agent: mu4e 1.6.10; emacs 27.2 From: Ignacio Casso To: Tim Cross Subject: Re: [BUG] org-capture autoload bug? [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)] Date: Tue, 15 Mar 2022 10:02:51 +0100 In-reply-to: <87pmmom9br.fsf@gmail.com> Message-ID: Content-Type: text/plain X-TMN: [AtKWh9AucJLAg32qV/sV/ixZs6qlkboT] X-ClientProxiedBy: MRXP264CA0032.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:14::20) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87tubz1bvg.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c13b824f-c7bf-44cc-ba93-08da06974a47 X-MS-TrafficTypeDiagnostic: HE1PR0601MB2154:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sVvTPZHa41Y1CNWGUJeNzsKGx6avDXc7DrnsRqbxzutcXxMTBIgqGCMyD9zrC+bcbHT1qxJNn/tVaVblb6n4f4Vf+AqgkuJ+vvA7n3B8HFHUR1emRqaU8FSPwWo2KZSZCe5N58Wnx9NATwKgcPl0eZlGUdUDNSdxZXE++TSk+HolRVWH+fxwIbILgC8cQ1kIgOqSEXpWn7OZA62i8Zgwu8+c1OMF46EhNQfJj7rxVq0nglExe2eWsciQBS4X0WcOMXKX2vCY8E5F3SCJE+JC8WSU6HByWa2+Mnm1338Q0O/uZTpobPeRRIfTGim4Zq9vBJ97tslpEdXuqSOis+AFb3q7XW9dZxQLDDbF+FAS54B/E8s0m4OVqNOTFuKKo4UxZJ5ATqlXc+sXlY3avn1rWLPFONuM4NT8Igzb2z5NYVu4MwbwCbEOtYQNRpzHXa2lpIw4Saj8fpYLlb4PbDRo/4j17iYtZrkNcy3fRddOKK7nmricOvmB+mcUiTjGpAHPDoxge112x8Q0NarjgP7mqnsW9CyN2c5NLlRcx0fj9MmVJEgo94hH7KYiOm3muNt+z8POPrJe0vAZV6mMUKEipg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nM0wrFo6JwQkCD+RiBYvm/LJOnISvJR1dH5VhNxhQhOhq5vaTX9A5t4M351k?= =?us-ascii?Q?5heE1/k8EObNwDk5lMGoayBqESzLBzv0XmiTK02M6cmXSLk5rFsXeU5uffWn?= =?us-ascii?Q?/+DbGrz39Ix7ukxvFyTZYTcw2Qje7xBuqFz0Jrg2xRb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v4pPK8BSy6n3zyktsiZzKKQTpxo0jxG?= =?us-ascii?Q?Yp0AlPqyRYsgiD4gc6gXc9HaW98gc7zHJ2ip/FfFPLDTrsZhno4ukIxBXQv0?= =?us-ascii?Q?zxF2/zkUKb+xLzSQMRRy39ZCsrO78oBiNg=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: c13b824f-c7bf-44cc-ba93-08da06974a47 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Mar 2022 15:20:08.6920 (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: HE1PR0601MB2154 Received-SPF: pass client-ip=40.92.74.35; envelope-from=ignaciocasso@hotmail.com; helo=EUR04-DB3-obe.outbound.protection.outlook.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, 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=no 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: , Cc: Max Nikulin , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647357682; 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=XpplAhx4eUt6ImEsvaHetsTvgMMInE3dA+1jL89E3jk=; b=TzMEPO8z780id/wZk6AjW6i/J1uaBQ5n9urpJyp5CYIdF2ubBM+OeSbZu/1p8lSxp6MO48 e/ED9wIEcbl5Xvt1ak7oybJgxb+J0CHrqa/PbwJcDtlxnrn/WMSWmBggS1lItaypVOA7oT QhrYMgXYWTvAa/unB6QVayJb8ZGYjg6itCNaSBgVez2VY2KvqifYA11BPTphucfHo9hiNL saeDwzcKPTCZ66bp9Mec9bk0L0YtlPM4h85xjFQr5XVFZKAHbPMlw/3d4kfCGxhs/316TC 71ziUYXbxT7gQXyGznEKqE3DYobFwzJsi1DKosZK0C4nl2zql8/7dz8N1WQq4w== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1647357682; a=rsa-sha256; cv=pass; b=rDI1p2PxyZXXsb7L/WyCc8CEhR6cw+NLNfjZbcuixn4OGBqI7FYIyhLZ426rNLBDrSrLXA KGjpg0rr3LiS+yaYlUNAXYHXDNEpkxonn0RHhyKuOGzy0+1VtFECUnEj3+yOo77cI2D9CF AwE3j/ey76eH29dyqwow+K6dNPjL8TeSgqqzEwHCSRgl9QCRdKIoY6SZLei66MVqlvL796 Y6YHQizjY5y6nXwFXfZUIvy0h4TBuktOli0oOUcL6fKhNz3Dja1lHGove34PiUfoEJ9XXq zCzT4qGwo3Yjzq3VmaEiXyxvOpQtLBCeyEaMYj+1xEahDoNC8BSMU2xeIKauJA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b="d7Izc/gx"; 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: -10.47 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b="d7Izc/gx"; 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: 88EB32CB40 X-Spam-Score: -10.47 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9JOD0uP8ZBQh >>> My recommendation would be to come up >>> with a non-org specific example which reproduces the behaviour and then >>> ask on emacs-devel, using the example to demonstrate the issue. >> >> I agree. I'm on it. After trying to build a simple example I have realized a part of my analysis was wrong. > Not really, all defcustoms have a :set attribute, be it passed > explicitly as a parameter or the default value, set-default. I was wrong about this: set-default is not the default setter for defcustoms without one, it's actually set-default-toplevel-value (although everywhere in the documentation and comments it says it is set-default). set-default-toplevel-value works well with let bindings, but set-default does not. > This issue happens with all autoload functions that use a custom > variable: if they are called inside a let form binding that variable > and the feature was not loaded yet, the let-binding will have no > effect. So this is only true for defcustoms without explicit :set argument if the let form is evaluated with lexical binding enabled. The following table shows all the cases and what works and doesn't: - Lexical Binding and no autoload for the variable -> The let binding is ignored in Emacs 27 (or more accurately, it's considered lexical), and an error occurs in Emacs 29 - Dynamic binding or autoload for the variable: - No setter (or the actual default, set-default-toplevel-value) -> Everything works as expected - Setter with set or set-default (the suggested value in the documentation) -> Everything breaks as discussed in previous emails So if we remove the setter for org-capture-templates, which is not actually needed as discussed, or use set-default-toplevel-value instead of set, it would fix the problem when dynamic binding is used, and in Emacs 29 it would at least produce an error with lexical binding. If an autoload cookie was also added, it would fix the problem also when lexical binding is used, but I understand that may come with its own disadvantages. I'll leave that decision to you, for me this is no longer a problem since I just require org-capture now before doing this. I'll write now the email to emacs-devel with all these issues and mention in this thread the corresponding debbugs thread in case anyone wants to follow it. Regards, Ignacio