From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 8JpnIcRLpGIt6gAAbAwnHQ (envelope-from ) for ; Sat, 11 Jun 2022 10:01:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AFsQIcRLpGKPawEAauVa8A (envelope-from ) for ; Sat, 11 Jun 2022 10:01:08 +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 DB6E9FD80 for ; Sat, 11 Jun 2022 10:01:07 +0200 (CEST) Received: from localhost ([::1]:56896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzw3O-0001cn-Hy for larch@yhetil.org; Sat, 11 Jun 2022 04:01:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzw0C-0001cW-3E for emacs-orgmode@gnu.org; Sat, 11 Jun 2022 03:57:48 -0400 Received: from mail-db8eur05olkn2081a.outbound.protection.outlook.com ([2a01:111:f400:7e1a::81a]:56288 helo=EUR05-DB8-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 1nzw07-0001OJ-S5 for emacs-orgmode@gnu.org; Sat, 11 Jun 2022 03:57:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BdpztuJbiSwoImhMwpFn32MDWVGDLgurjBrPiua59sBfQz+b7kBEkFONHnsRfmulWHguf8GMyLdQ4j95/rUCOUyHkpG/4nntEpnl5TvPnoW5TDMW9nU9fB5XnX6Yf8QM1upn8Z0cAnXRsOnwGnvaIgIO0uuRu0mlZsWPpQbrFeLZRXlkULGijpqeQ/h+tVrbmUm6hBJ9DkZCzKOLk17si8ZvQIjnB/7IYMShUgeLMMhqZTgmlcS4xEKaokJR+U4P6J9r3xAAZfNLo2ky8bZ9HlYEm0xbcVNZu1G/uTmYscgKBKuy1rUuCmW2y2JTn0QcRqyvPgnKwkvJh/Fa58kMag== 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=YYhGnq8nmLWmoVKoWG3bBryIe+WqTcUEpkc1CWpb/i8=; b=BVBSdYxkQlRkINOpi/XYf5XCRjX2ud4YKhonxUd84TpLw+HTPNSIFtFY8AqbxYgob9VPTLw6V5Al4ygee+klzPkupEVzZM8eJgxm7j3X9BTsVt83w1tKKseAgi5Clzs843l8Y7aQj57hgKB2e9zCb4bGfbZIlBR5ZkiZ9Cr0R0WEWezCp0YN1I4l/E7hnBGoagFs6bytJ7v6mqsm8aLfW5pYi/+qR2c2uWQWAY+LbRrHKC1QjqBtu/KOeeHN13fnQ0XJ2AV2wGBb+Llz+dsv/GCN9YOe2IJ7dM8S/VhhNIq3wyjEyLFYl6MkKEIs09DzG7ooz+hjA9/fDg5HCEKy2Q== 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=YYhGnq8nmLWmoVKoWG3bBryIe+WqTcUEpkc1CWpb/i8=; b=S0+wICmakPU2wi0nmdEz0nV8IYvffFuJZ7xp0JDmTCTgOLxvuEqBDS4SZNOuwlLdNQZthPMIgSLzSMtIMLEOEXiEererRNm1zflPQuHBjpoLJL1hodXZiHpDvQV7Mo6tyfB7CM6nLIi0jO5AvZC1xHiWC8Tbe4eN3tfaEUvAsg8n5fOb8dBGz1LEXVhkxc6rKP84pwGJ+M5CC7mHoUDNG1bKaBK2wJKD0S1aq/MJZjtpXHqQwxeN+ynbpLzcSrepM7n5qiJjBYoDYss3z8pP835X4t21jOanOwqP0csDrmmeEDYxMtKBuCExuwYBj/HDBO9Jx6f9/nXbaTQOpdaRUw== Received: from DB6PR0601MB2087.eurprd06.prod.outlook.com (2603:10a6:4:4f::26) by DB7PR06MB5387.eurprd06.prod.outlook.com (2603:10a6:10:73::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Sat, 11 Jun 2022 07:52:39 +0000 Received: from DB6PR0601MB2087.eurprd06.prod.outlook.com ([fe80::cdbe:e542:a1b6:1a2]) by DB6PR0601MB2087.eurprd06.prod.outlook.com ([fe80::cdbe:e542:a1b6:1a2%2]) with mapi id 15.20.5332.014; Sat, 11 Jun 2022 07:52:39 +0000 User-agent: mu4e 1.6.10; emacs 27.2 From: Ignacio Casso To: ignaciocasso@hotmail.com Cc: emacs-orgmode@gnu.org, Max Nikulin , 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/)] In-Reply-To: PAXPR06MB7760A3031924BA897FD082E4C60F9@PAXPR06MB7760.eurprd06.prod.outlook.com Date: Sat, 11 Jun 2022 09:50:32 +0200 Message-ID: Content-Type: text/plain X-TMN: [mKBFoqWVhvNBYK+hLuFNGdoEnG2xYsV+] X-ClientProxiedBy: MR1P264CA0137.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:51::21) To DB6PR0601MB2087.eurprd06.prod.outlook.com (2603:10a6:4:4f::26) X-Microsoft-Original-Message-ID: <87fskbhc1o.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5252bd4-4652-4414-b8d6-08da4b7f5aae X-MS-Exchange-SLBlob-MailProps: 6qklvm/at0pykcgy6k6WajSOnJqlAKH2VjE1RedTCyb0118bo8D+c2iBOJ2LwDQoaV6SuG2Z02QZVGfOpZrKH3Hau0GluYdlI0ii+23SswEgS9THxRBTMN1JS0DkPKSYNshmrw44oRERqKoruIVi+2JfRdS9etclpHwglXBz3M6dN0FGBQXqUS8VBxGFaZM+wSrytwdkdGhlyoOhg9xAYDvBDVBI3al0VqyDg9BXXWGn0Z01hJIaFZ/KriS7t1xN2TfVQbz89K8Bvi3tcPdB9nazRjBIyItGLPsOA/v5k41wEwapW6IF6veRyTWKsA966sJ2WwhucFH7y8xraQ0b7E5it2gG8UkLH5R/hfJiFKZcXXn/cAnkcKU8qUA/qQZNDp5mwbUTapzRTp+7j7lZflO/E13BEpBzc2qqeo9xpIlfnbHL/9WOkE30zXOYZ++61B1LeC1Jnv6zfV01m08i7dl+Vf1RoUA9hbrO5dgoUre8qPZmfxP2GoiB1X2oAlAdnsg5XNtm2vnAfPuamT8MMrNujA66Bq4AYY0+4WeUh5UVCuqTPu50KGhaDCF0vj0SgUQmlLQt924uZ1sxG+Szqq4wf2P+gA3WFQk3SGdhbXb47XfokwfN8iVc/Z5TuHFtcyxGTBzqtjdFDLd50bWFaCrjnJnHoc2DpbcBDjXg6nR00GB9G/rCoIYDFT3WQ6ElEPRVNWxPXA3YA11CAA4RrrmUVbEIQNV6tZsX19247Z/TtmeTIZMBhY7cgCq1dmJiOScgks5S5LYkgr6d0fo/NH5sK9Tu0Ro5BpzKaP8FqW/M86Z0gbYSOP5iO2F9Evtj X-MS-TrafficTypeDiagnostic: DB7PR06MB5387:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HovLjwrUp1hRaHgtWdOrELJgLxv9QR/q9P7agxCovGwQQt5kHLaqILT3WI68wh7ShlMj73c1jGcm8RGd+pwDRoYPtkvdl/7VsB+XNW7fqVKoORZQQfkGIYdQte/7IfZbKHX9tzbo/aGcVsads6flRbN/0FQlr3PEtuHKaJjGSL00fJlcGK4o5Z6mUdDutI3HFoXd5ifjouJUAV6tjINTwcwx65p9xqVJlUTXy5wZqIYIsPosMUO0K8KNgroHF21hCnUrD/AvyBbfKNEcOPtlQtlQjD6m6jny/bFc73vGoEsVS6OK/8k8hTsFqmvuvTRdhzRMh/nqwEmPs7YfSOIh2f+bk7nYYnEqOvwdUc9nNe5DYrUKryEliVHQ1YXAH4uesxUelF+14s4CVzdE8VAg6bmm3l3eKeTGIqFijwflJwRGpeeBVFhSNw0nlljlIhS3BaTS43doLx7KwDgEpiYykcraYlxH3YXAO0vtvYunWGGjozGr3/ZV/1cYlVMRkSCsFmlRowEZrQGVW4Orvh+b/XaSFbc/BAiZo7SLJ63G7z6dea0pWZvk3DB1Ubu9kI++8e0BYDFubgJa1t3/atM2uGfOqKJtj+wcHllLKYf8/6NzWHnY7I9iuO9IdTOguiwk X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?cotHTBntS4HQ5lQDFNpQ9oGEZFC3luAkPhGzQA5P3ICG9m7B0XtmI2fQ2vKA?= =?us-ascii?Q?XLA6ZWja2U0EB+XJR0spHfC4BNOay7YD89e3H5O4PFKGi+fC1zFuhnO3xxPU?= =?us-ascii?Q?oJVtn7P8hWuO3nO2nisqZC94baQ77ofZvV9Pb2IkRGxeUcdHbzMiJ/Tm11J0?= =?us-ascii?Q?zHjC0w3f7mRHZOJ4WZvR63iwfAT0CZOm0kTLHDPh9/wSX3/CMRQHx2yB8pNF?= =?us-ascii?Q?Qn7uAuDT+xMwegkBW748+Bltf0QKwUnO3miHErFDji9vrym4KdNpuSVJBu7E?= =?us-ascii?Q?YKMFZwBpWzDbzCv7vQoZinn+uCwfRi8f2s+iDqJKTcGLGAhu2ir1NiZucXtN?= =?us-ascii?Q?qS/wDWz0iuk/S5lWJCOSrFZWdRCHpYEzeLceoI7j+33mxZFmrrWPzPHSfeyl?= =?us-ascii?Q?3rScPbc2hBZ0EUIFUf8HX8DZMd5IXirg/PkVHdkFBPVemgoqa21/4F7h+U8I?= =?us-ascii?Q?vLuFnnWD1iQCcNQDyJM4osh8Wx9/R8abCfCm4AlJxsmI+C2pjM7Q4Bg516sd?= =?us-ascii?Q?i4GUpMsPTjxeQLwCF0k/OJm9jayZ5jlVO63RzP9tuEr4QnmSNp8XD6AaGcaW?= =?us-ascii?Q?nc4oMk30uUlWTHWdxLk/6DrsJdAQwoB/dhfx61kojHCzG0NGCx4fmwOq6k14?= =?us-ascii?Q?5Tb1OJ3nmmvn+KqRNjIsFpLWEEcZUgOx+oMU/dccc7y7y5OS2W4/K5NC3OIu?= =?us-ascii?Q?uCsifGn0k3KaGfSBAsEbtLDEAxwoLdqP6bDpvpFE1c7wRoHEb5+KQZ9TWx80?= =?us-ascii?Q?cl2wMbhYMmWv3xTYmTL7e/b0xs8LkBMsTY3HvFTJuXy8ts8j3i9HagtNFd/f?= =?us-ascii?Q?1xFMlJWqBhMUGTJmwGsvqG1m9mlj6lEF0rhULOnMvTwVDxsxIUngge/iA10e?= =?us-ascii?Q?2hUyPZh6QFvJU1S1bPCpxRW2/57LxBvqLInh0st8fZ4apR924UYA5Q4JCBh/?= =?us-ascii?Q?GWEtlO0GuSHOVeRKAyodxHLOrfsG2YXQL/V52W4PwuhdT6VFVwXcJV/TDiVZ?= =?us-ascii?Q?B8cFIXAE2nA2FHQG2YJ4/KpFa1uRQ9j4gRkqQo2tIOOSgvtkxxyIbuBXYUZl?= =?us-ascii?Q?u0q2KugBn4AaWcE418Y6Xr4oPN/M5eOY13xiOX6R6J510ig+YEjZygNoreOY?= =?us-ascii?Q?TgOSifYn5g6Esg85JG0tXZubpANzR+VFHlQB+dIiuAzrRj+JLXpRb53GzbEE?= =?us-ascii?Q?vakb34NLfapuPwEqumSh/6aCgOjOEbGYGJaH5UTI4WCz0BjvXbQy67PBJWfy?= =?us-ascii?Q?zlc9AhIujnGZ7/Baijj28GVh31oNi3H3qies9ASmw3s0jrZKMTsxUfwMfzs9?= =?us-ascii?Q?p3lp4DQalRkjj2XDhM0VaJzc6kNWcal41YcnEDFFXu/RzDnrUNSRr3Tfzkz+?= =?us-ascii?Q?/oFCi2JyDeSYrHNK8VxViLx5ZCdgOZbCbdzqF7phUZYH0aM8EJKGSgrVpX2L?= =?us-ascii?Q?BqY1oFZOGSZHoInVqVMOY+3oQAqS8Tbj?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: e5252bd4-4652-4414-b8d6-08da4b7f5aae X-MS-Exchange-CrossTenant-AuthSource: DB6PR0601MB2087.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 07:52:39.0050 (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: DB7PR06MB5387 Received-SPF: pass client-ip=2a01:111:f400:7e1a::81a; envelope-from=ignaciocasso@hotmail.com; helo=EUR05-DB8-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, 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-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=1654934468; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=YYhGnq8nmLWmoVKoWG3bBryIe+WqTcUEpkc1CWpb/i8=; b=Dp6nc7xWQmrqjJcB02jsw1LKpD6mYHan6VhEvnV0mgkje8U3EZ2cAMzQnogUBGcVZN71Od KRYCQNhgHZkFnMTO1DaYe83zI9qrLblA8gefx2pFU8hGK8c3wAGN3uyOjGtcCavneakUlI xy9z3uk4Uu/JD9vCtNsIKVmjeB9rq3GiOQtH09TaGWB0VA/y29AVIk4AyTCvyMjw8hoMrz j+2BddUacsLbEO3or/7EZi9vtqfITanFoGGs8LADHmCBsQKmX5KSB/bgKg94R0RDUUVXXQ Ro4Gch/Kd2nGJlsaoIJMTVw8ldGWwYhfExBZv1tkD1CQEYD4cCxi23QtbU8G2Q== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1654934468; a=rsa-sha256; cv=pass; b=K5IajxOADVYIVhNHkI/FiLYPH9u5jaKINYtCt+rI4JiHCX1+xMESpb3XoFfQbuo5fsTFKK osG3nfL3C2yMSq7QH0ghtmVLDBdjLyzDiOJqFQ8BZV5COzqJWrcPk9lXtxM/R0YOhXW9Jn 1/nL9DjxiyUtq51O7v2SIarA47L69FdOHJfxhWfq01J75qq6OFUuT6gglwMOWjkiRkzpmO kozONchpPKR0va/saSXsmUObnGc/D4nBBvT6l3xGzuai6DhvlcgMHYEOn8Q3dVtiD8vwS+ 3rSHvFgEAXdGKM84pEURg3Z70MjVlSB5lmPjlBXMBdge78JDeWHr6cx/Tht21A== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=S0+wICma; 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: -6.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=S0+wICma; 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: DB6E9FD80 X-Spam-Score: -6.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: SmUIpXHRKBke Hello, The bug I reported about this to the Emacs devel mailing list (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54399) has now been closed, and some documentation has been updated in commit 071722e41120. Basically, the problem is that in order for (let ((custom-variable local-value) ...) ... (defcustom custom-variable standard-value ...) ...) to work as expected with dynamic binding, `defcustom' has to set the variable with `set-default-toplevel-value'. This way, the code inside the `let' form uses local-value and the default value is set to standard-value. If `defcustom' uses `set-default' instead, it overwrites the local value, so the let-binding is useless, and after the let form is evaluated the variable is void. The problem was that `set-default-toplevel-value' is used by default, but the documentation said that the default was `set-default'. So either whoever wrote the `org-capture-templates' setter was misguided by the documentation and used `set-default', or more likely, that setter was written before the introduction of `set-default-toplevel-value' in custom.el, and was never updated. The first thing we should do is finding all uses of `set-default' in the org `defcustom' setters and replace them with `set-default-toplevel-value'. This would fix this bug and similar ones when using dynamic binding, and would not affect any other use case. Then we should decide if we want to use autoload cookies for custom variables to make this work also with lexical binding. Otherwise, code like the snippet above would produce an error in Emacs 29, and in Emacs 27 the let binding would be ignored (although at least the custom setter would work). I have no opinion regarding this last point since I don't remember what were the disadvantages of using autoload cookies for custom variables. I've prepared a patch for the first point, which I attach at the end of this email. All changes fall in one of the following cases: - `set-default' -> `set-default-toplevel-value' (as explained) - `set' -> `set-default-toplevel-value' The same, but in this cases there was another bug: If a buffer set the custom variable locally before the feature was autoloaded, the setter of the variable would not set the standard value as the default for other buffers, and would overwrite the buffer-local value. - :set 'set-default -> nothing, since it would be already the default I don't really know what most of the variables whose setter I have changed do or whether it makes any sense to use them inside a let binding, but I have made the change for all of them nevertheless, since it can not harm and could potentially fix a bug. Feel free to restrict those changes only to those variables where it makes sense, such as `org-capture-templates', if you want to keep the patch small and simple. Best regards, Ignacio [2. patch --- text/x-diff; 0001-using-set-default-toplevel-value-in-defcustom-setter.patch] >From b20e23013329fab574a4d05eb5be8cde1d43dad1 Mon Sep 17 00:00:00 2001 From: Ignacio Casso Date: Fri, 10 Jun 2022 12:39:43 +0200 Subject: [PATCH] using `set-default-toplevel-value' in `defcustom' setters --- lisp/ob-lilypond.el | 2 +- lisp/ob-shell.el | 2 +- lisp/org-capture.el | 2 +- lisp/org-clock.el | 2 +- lisp/org-duration.el | 2 +- lisp/org-faces.el | 2 +- lisp/org-footnote.el | 2 +- lisp/org-list.el | 4 ++-- lisp/org.el | 23 +++++++++++------------ lisp/ox-odt.el | 2 +- 10 files changed, 21 insertions(+), 22 deletions(-) diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el index df128441a..dc33ebc17 100644 --- a/lisp/ob-lilypond.el +++ b/lisp/ob-lilypond.el @@ -107,7 +107,7 @@ you can leave the string empty on this case." :package-version '(Org . "8.2.7") :set (lambda (symbol value) - (set symbol value) + (set-default-toplevel-value symbol value) (setq org-babel-lilypond-ly-command (nth 0 value) org-babel-lilypond-pdf-command (nth 1 value) diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el index c25941a44..4454e3b5d 100644 --- a/lisp/ob-shell.el +++ b/lisp/ob-shell.el @@ -68,7 +68,7 @@ outside the Customize interface." :group 'org-babel :type '(repeat (string :tag "Shell name: ")) :set (lambda (symbol value) - (set-default symbol value) + (set-default-toplevel-value symbol value) (org-babel-shell-initialize))) (defcustom org-babel-shell-results-defaults-to-output t diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 773234967..948eb8bc6 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -376,7 +376,7 @@ When you need to insert a literal percent sign in the template, you can escape ambiguous cases with a backward slash, e.g., \\%i." :group 'org-capture :package-version '(Org . "9.5") - :set (lambda (s v) (set s (org-capture-upgrade-templates v))) + :set (lambda (s v) (set-default-toplevel-value s (org-capture-upgrade-templates v))) :type (let ((file-variants '(choice :tag "Filename " (file :tag "Literal") diff --git a/lisp/org-clock.el b/lisp/org-clock.el index e0c40ae23..b94c79baa 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -493,7 +493,7 @@ This variable only has effect if set with \\[customize]." (if value (add-hook 'kill-emacs-query-functions #'org-clock-kill-emacs-query) (remove-hook 'kill-emacs-query-functions #'org-clock-kill-emacs-query)) - (set symbol value)) + (set-default-toplevel-value symbol value)) :type 'boolean :package-version '(Org . "9.5")) diff --git a/lisp/org-duration.el b/lisp/org-duration.el index b242a6f2c..338ea11a9 100644 --- a/lisp/org-duration.el +++ b/lisp/org-duration.el @@ -98,7 +98,7 @@ sure to call the following command: :version "26.1" :package-version '(Org . "9.1") :set (lambda (var val) - (set-default var val) + (set-default-toplevel-value var val) ;; Avoid recursive load at startup. (when (featurep 'org-duration) (org-duration-set-regexps))) diff --git a/lisp/org-faces.el b/lisp/org-faces.el index f919a6b47..5fb6c3e07 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -338,7 +338,7 @@ determines if it is a foreground or a background color." (defvar org-tags-special-faces-re nil) (defun org-set-tag-faces (var value) - (set var value) + (set-default-toplevel-value var value) (if (not value) (setq org-tags-special-faces-re nil) (setq org-tags-special-faces-re diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index 0a5f994a4..8e0ac0da2 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -110,7 +110,7 @@ you will need to run the following command after the change: :group 'org-footnote :initialize 'custom-initialize-default :set (lambda (var val) - (set var val) + (set-default-toplevel-value var val) (when (fboundp 'org-element-cache-reset) (org-element-cache-reset 'all))) :type '(choice diff --git a/lisp/org-list.el b/lisp/org-list.el index 515763036..af560cff4 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -235,7 +235,7 @@ interface or run the following code after updating it: :type '(choice (const :tag "dot like in \"2.\"" ?.) (const :tag "paren like in \"2)\"" ?\)) (const :tag "both" t)) - :set (lambda (var val) (set var val) + :set (lambda (var val) (set-default-toplevel-value var val) (when (featurep 'org-element) (org-element-update-syntax)))) (defcustom org-list-allow-alphabetical nil @@ -253,7 +253,7 @@ interface or run the following code after updating it: :group 'org-plain-lists :version "24.1" :type 'boolean - :set (lambda (var val) (set var val) + :set (lambda (var val) (set-default-toplevel-value var val) (when (featurep 'org-element) (org-element-update-syntax)))) (defcustom org-list-two-spaces-after-bullet-regexp nil diff --git a/lisp/org.el b/lisp/org.el index ac94fb614..c57ccf319 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -231,7 +231,7 @@ Stars are put in group 1 and the trimmed body in group 2.") ;;;###autoload (defun org-babel-do-load-languages (sym value) "Load the languages defined in `org-babel-load-languages'." - (set-default sym value) + (set-default-toplevel-value sym value) (dolist (pair org-babel-load-languages) (let ((active (cdr pair)) (lang (symbol-name (car pair)))) (if active @@ -706,7 +706,7 @@ defined in org-duration.el.") (defun org-set-modules (var value) "Set VAR to VALUE and call `org-load-modules-maybe' with the force flag." - (set var value) + (set-default-toplevel-value var value) (when (featurep 'org) (org-load-modules-maybe 'force) (org-element-cache-reset 'all))) @@ -837,7 +837,7 @@ depends on, if any." :package-version '(Org . "9.0") :initialize 'custom-initialize-set :set (lambda (var val) - (if (not (featurep 'ox)) (set-default var val) + (if (not (featurep 'ox)) (set-default-toplevel-value var val) ;; Any back-end not required anymore (not present in VAL and not ;; a parent of any back-end in the new value) is removed from the ;; list of registered back-ends. @@ -862,7 +862,7 @@ depends on, if any." backend)) ((not (memq backend new-list)) (push backend new-list)))) ;; Set VAR to that list with fixed dependencies. - (set-default var new-list)))) + (set-default-toplevel-value var new-list)))) :type '(set :greedy t (const :tag " ascii Export buffer to ASCII format" ascii) (const :tag " beamer Export buffer to Beamer presentation" beamer) @@ -1815,9 +1815,9 @@ are followed by a letter in parenthesis, like TODO(t)." :group 'org-todo :set (lambda (var val) (cond - ((eq var t) (set var 'auto)) - ((eq var 'prefix) (set var nil)) - (t (set var val)))) + ((eq var t) (set-default-toplevel-value var 'auto)) + ((eq var 'prefix) (set-default-toplevel-value var nil)) + (t (set-default-toplevel-value var val)))) :type '(choice (const :tag "Never" nil) (const :tag "Automatically, when key letter have been defined" auto) @@ -1899,7 +1899,7 @@ be blocked if any prior sibling is not yet done. Finally, if the parent is blocked because of ordered siblings of its own, the child will also be blocked." :set (lambda (var val) - (set var val) + (set-default-toplevel-value var val) (if val (add-hook 'org-blocker-hook 'org-block-todo-from-children-or-siblings-or-parent) @@ -1917,7 +1917,7 @@ This variable needs to be set before org.el is loaded, and you need to restart Emacs after a change to make the change effective. The only way to change it while Emacs is running is through the customize interface." :set (lambda (var val) - (set var val) + (set-default-toplevel-value var val) (if val (add-hook 'org-blocker-hook 'org-block-todo-from-checkboxes) @@ -2368,7 +2368,6 @@ The formats are defined through the variable `org-time-stamp-custom-formats'. To turn this on on a per-file basis, insert anywhere in the file: #+STARTUP: customtime" :group 'org-time - :set 'set-default :type 'sexp) (make-variable-buffer-local 'org-display-custom-times) @@ -3275,7 +3274,7 @@ header, or they will be appended." (defun org-set-packages-alist (var val) "Set the packages alist and make sure it has 3 elements per entry." - (set var (mapcar (lambda (x) + (set-default-toplevel-value var (mapcar (lambda (x) (if (and (consp x) (= (length x) 2)) (list (car x) (nth 1 x) t) x)) @@ -3548,7 +3547,7 @@ After a match, the match groups contain these elements: (defvar org-emphasis-alist) ; defined just below (defun org-set-emph-re (var val) "Set variable and compute the emphasis regular expression." - (set var val) + (set-default-toplevel-value var val) (when (and (boundp 'org-emphasis-alist) (boundp 'org-emphasis-regexp-components) org-emphasis-alist org-emphasis-regexp-components) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index aa6e90122..9b46f15b5 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -404,7 +404,7 @@ with GNU ELPA tar or standard Emacs distribution." "Set `org-odt-schema-dir'. Also add it to `rng-schema-locating-files'." (let ((schema-dir value)) - (set var + (set-default-toplevel-value var (if (and (file-expand-wildcards (expand-file-name "od-manifest-schema*.rnc" schema-dir)) -- 2.25.1