From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 6F4QIcQnlGJoRAAAbAwnHQ (envelope-from ) for ; Mon, 30 May 2022 04:11:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8EUNIcQnlGLifwAA9RJhRA (envelope-from ) for ; Mon, 30 May 2022 04:11:16 +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 E611DA315 for ; Mon, 30 May 2022 04:11:15 +0200 (CEST) Received: from localhost ([::1]:53092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvUsE-0000hA-R9 for larch@yhetil.org; Sun, 29 May 2022 22:11:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvUqr-0000gR-Bs for emacs-orgmode@gnu.org; Sun, 29 May 2022 22:09:50 -0400 Received: from mail-db8eur05olkn20810.outbound.protection.outlook.com ([2a01:111:f400:7e1a::810]:19488 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 1nvUqn-0002kk-JD for emacs-orgmode@gnu.org; Sun, 29 May 2022 22:09:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ibWJ1TItcHSyI/e7yVPZCpflTzpXKJeOiEver7cUo49Yo+6+PasIXGIkg9UwdLkCO3ioLlyuvoRHJ5JFOhk7BBMoY2WhKPH6WnojvAn/NmVLaFKGOHsgyQIXcyo+fwLNdl9MFuDoIKfKLTv1LLWrXy5HJhiSdJuD/FM8CvryfzNrK/0VjomnEMsf7Ho3mh7ewd08CWNolYS2EOtUTvqmTByv6OqkXOlVGkTFM9OmFjvInWrZiZdPjc44xG+jQTiLBdeHGj0CFGiXJvsUeNgSGLdYRmdN3Z1+/R6N+CD3h5VZ8Z1Qk5UBbyqkJmaJt1ZbDdL2wLwWI3mP6yEYkD+OFw== 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=ta45BATuBrIhyI6U34+6gZbvIzD7wSETMquDHhvDFr8=; b=DMncVc1rdb+JwkuU7Tuj/alzgQ/QVNmZd0btGOkXGln4Z51QwqyNUpWD6MQTch4R2yGdSi0hSZtXEHFlcqFmF+IN7x1wjhNoL0AvMlGBmj3uJKWz06rAl5NY0fkZwJwXIn3qh/RhJSXGkLSWjz0vZCdd77yAdVcN6h15eHrOK3RX/6BY0kzj2k4dIPM7an6x+MDaA9w6wgot/xbJDnr/W+4NqHOeb6geItyDLY+/mCR7kH+6F8a9DTVI2MG0h1ViSlINV7WWZ8hTIuTJ6pXhcMRgPCqzOTrWL6nK9LBpLpVQw/ykJOTPxVmQ5tQTXCmwUKPZsR6Zo9vqr6zL1crWRw== 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=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ta45BATuBrIhyI6U34+6gZbvIzD7wSETMquDHhvDFr8=; b=Yz/zF225TBSqZIObHUDy85QQacjBreavPsE7o80yh/Nhg0Gy7//ONuGiwZFDK4Sn86IRVogoRan0ibp9R79/l7blJJDd39ux7ry8uT92z0GIQgoiHbGVSlRSE38QZWMuSghWyfM06aSrQWimSiARbZ5cC4A78lAGwczkjnsn7oaZuL4OG7XHhBQbIVKJ7f3i5ZxqYENQIKmzrZPjjYXjlzhU3S+w8azOiZrGPhijNBDqui53kIo/c4UfPc1bn5ZKZz8qePRgv/30v2q49k24+F/NNyFyxLxMMpLgHNtPwZ77QX61Y/wtmPaLPCzN+SBU7XcMa0Sx0iC/4z4V3FHhVQ== Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM6PR09MB2616.eurprd09.prod.outlook.com (2603:10a6:20b:4b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.16; Mon, 30 May 2022 02:04:41 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::48c7:3657:142f:a842]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::48c7:3657:142f:a842%4]) with mapi id 15.20.5293.019; Mon, 30 May 2022 02:04:41 +0000 From: Arthur Miller To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: Proposal: 'executable' org-capture-templaes References: <87mtf3tui1.fsf@localhost> <87pmjyco0x.fsf@localhost> Date: Mon, 30 May 2022 04:04:39 +0200 In-Reply-To: <87pmjyco0x.fsf@localhost> (Ihor Radchenko's message of "Sat, 28 May 2022 11:51:58 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [8cuvaotd4ZVyDGy7QmJlmCal0aUcqLnu] X-ClientProxiedBy: BE0P281CA0035.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:14::22) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87h757ojwo.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7b079ba-e427-4bf1-d615-08da41e0c1a1 X-MS-TrafficTypeDiagnostic: AM6PR09MB2616:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QZ8x9Ue9tWbQ6Y5/h00cvLZgjOwAc3rRiQSAQ826+lf1dy6Wu07x5R+InfbAsXrYEbz8sSf8tP3hjwiFa8z3IJtSo96VebJhlSzFQLzy774s/dK2A72VG0u69KHGpXj4DZueR8mttbPHlCaGKpz6X4wC4UhD1GW4GTSWwlWobICoaxVLmgtGOnG9xI2cbXN6QKqg3cy62lT5ncnJZGGkhGtB5Lh26LeFV6IUZ3ZpvW9z8498USHqtdbneON0LBMJjW0tIOiaJO+6HDqxr1PFsPTQF8yS8qB12em+NJnKDS9pmHOPEFCEEU76AI4K+xGOhRxnv0O37qvbanzZuguxJ5wi03lxSJcZHU1DU8WN8FlF3ebX8jblT0BgNi+PGY17VJhamykbIMNXqE8ZWnUxQtp39V4B00K1pmb8ATtSuJTaXGJgl+b39B5xEKDE4s27D40RJHM6o2+X/HWPPZcZ7V5Bsd+NR/WllROyZbVgh9udPNbDdPxLsXad/yw40SuaZoqf+tL7SE+c+TlEjSaXOWbz/bMzbkCK8QRUap+N5YC8pd1K0hcqqnK7N6jZHx7EKk5wkSByXEybb4ByzxZhIPNcrpoSqG30ErMnTRoqXZaIwXr+ZRI++m7JF7jiehU8 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IV2JbIjpy40ZnUnHhvTKEt4ZVe/DQmnZy4mu6rqb9LN/ZBdKkl/9lxRDnZYB?= =?us-ascii?Q?8jaFVr15ZY2QBF1deFc+1mSgU8MDoWxexUqombTnqrhstMiphI4yUaucgQOJ?= =?us-ascii?Q?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m4jO7oIG4NVFVxeKeaFVe2?= =?us-ascii?Q?PN087y6Ktvr87h3pwhmOXbzjqKwR1NBz+fxcmjkNhCkTdQHPKjy21yGYhXLq?= =?us-ascii?Q?i9xdS/i7U4p4OHCWCA82FqqMLVKQnsSOUwUOpEFt7qxWTqiWYtEOWuQ6AcAR?= =?us-ascii?Q?mcpkClJkMKnk2Dte0FUJ2yb93axUEy2FTBiUGHHGVqWyRMt3rDImcoWGqj5o?= =?us-ascii?Q?pmsHG7nUkZWDhrQhwBFPtiZubhPuYnJKnL1MjG6JoVvtAYrth0K64U2bd2Dw?= =?us-ascii?Q?emdDAtxvM1kBItAfpHCQuHE1dgJ9oL/SJGtOmtBsHbmvkxyfVHYBAHBPFGyW?= =?us-ascii?Q?k8SbJYFWnakafNp74fpJMF5Tu22LiohDf/mngOTrX+/cgTriC2S0CtHYXZ8J?= =?us-ascii?Q?kbY9cucHYHQs7pPSUIar8FaqYign30+VT2jCZehKbgvNkuLYFA1mBSoIeG5v?= =?us-ascii?Q?jmOu44BNpKA=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: f7b079ba-e427-4bf1-d615-08da41e0c1a1 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2022 02:04:40.8604 (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: AM6PR09MB2616 Received-SPF: pass client-ip=2a01:111:f400:7e1a::810; envelope-from=arthur.miller@live.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=1653876676; 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=ta45BATuBrIhyI6U34+6gZbvIzD7wSETMquDHhvDFr8=; b=H50ZkpW31CF3vr0XVxdmeFo2r2zwhxNDeenSERbBgWG/BujQG3jKz6fMPBq/via/65Hqww GWwPFVmg6UhY/d6aJJ4+hSHvCQLymZC3DgTMWZOJPQkmVVkPBMqIGBmYAH3mvpqcF/9hqC f37PS4U5vTnJHOOglQJAjzZwYEFA4UDtr/li88oqS6IcgvaILA56LKiHZfzAkz+L0RVyWR uCC3DHSZA+9HxJZHggMHRRRgVnq8MQbFboO6DIlFJz3D2KgRej8atVdU0gLtqub3gNH6Kf rnfDdOESEWEMRz2AlahWntAbUlMHX/jRYfppqzBKIjCfp285DoY34T4wetoluQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1653876676; a=rsa-sha256; cv=pass; b=CVJzDD+HNHve8O4Gdo7CAOW5fzTbsXBgVA2TkWNZ1hdAxQgP7KpXdjLevPEXovJEsZ691s T2sArpHynpOpN73daK4PKkqFpsXme9LTYt41uYje0FeZ2NVoA9uPCjNwcSDr8dC1SaS9qQ GUHSx269GwC959dSYPZr1rFfWazVDe/k514b/UpX1OnlwGjVjl6zRKncyzuDCL476Fsv7Q KAIkDYqpAYaj1h/Dpzzfuvky5RfUWT7GnB8UAVPWTk/Jjh6nzX3sRx9yayYiey/ATn//vD lqs7HWSjfYYsOLN/2FrjlsSCuCXhdwQZCGZUrD9p/cMkTHEQ0nlObyJtxysOGg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b="Yz/zF225"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=live.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.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b="Yz/zF225"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=live.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: E611DA315 X-Spam-Score: -6.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: o+r6px77/IWJ Ihor Radchenko writes: > Arthur Miller writes: > >> Simplicity comes from the org-templates. Me, and I guess other people are >> familiar with org-catpure templates already, and I mean, can it be simpler to >> create a menu of choices then a simple list: >> >> '(("key1" "label1" exec (lambda () ...)) >> ("key2" "label2" exec (labmda () ...)) >> ... >> ) >> >> People are already writing those as part of org-capture, so there is a >> familiarity factor. Transient has to be learned, and the complexity is much >> bigger. > >>> If anything, capture >>> menu might be factored out to a generic menu framework. >> >> Please no. Not every single piece of Emacs has to be a generalized >> framework. Generalized frameworks add an extra layer of complexity, and it this >> case, as you point out, we have other frameworks, so yet another framework is >> *definitely* not what I ask for. > > By "generic" I did not mean general-purpose all-functional framework. > We just need something to remove code duplication in > org-export-dispatch, org-agenda, org-capture, org-set-tags-command, etc > They all share pretty similar code to generate dialogues. > > As for familiarity, I understand and it is exactly the reason why I > suggested to factor out the menu code from capture templates. I am not really familiar with those other dialogues but org-capture, so I only had that one in the mind. Yes, I agree if the similar code is used/shared in several places than it does make sense to refactor it out. > I am strongly not in favor of adding exec to org-capture itself. It's > a bit like if you were to add :activate-func for a link that actually > downloads some file from internet, then generates and exports agenda, > and meanwhile also restarts your remote server. This will also kind of > save the code, but completely out of purpose of :activate-func. Of > course, I am exaggerating here, but just want to make my point clear. I understand, it is ok :). >>> We actually had multiple threads discussing possibility to port all the >>> Org dialogues to transient. >> >> I have unfortunately missed those discussions. But as said, I am not in to argue >> for or against transient at all. I would just like to re-use the org-capture >> code, since it is already in-place. > > The last one was > https://orgmode.org/list/8c364693bf6856e60cdd3e8b63ab0c9284d16733.camel@heagren.com > And we had multiple complaints that Org menus are not searchable and do > not allow recursive edit. I am not sure what complain about searchability is/was, so I should not say much there, but those are just a list of lists, saved in a well-known place, org-caputre-templates var, so one can always traverse that list, or search the menu buffer itself. Anyway thanks for the link, I have read through that discussion. Seems to me like most of you are in favour of refactoring org to use transient everywhere? >>> It seems to be quite out of scope of org-capture. >> >> Maybe, but than what is in scope of org-mode or org-capture or Emacs? We are >> constantly bending code to do what it is not really meant to do. Since to be a >> DNA of Emacs :). > > Sure. But another feature of Emacs is being consistent. Emacs does > provide flexible interfaces, but they stick to they purpose. Abusing > them is up to the user (with no guarantees to work in future versions), > but not up to Emacs itself. > > If we were to include your suggestion, we would also need to maintain > the new generalized functionality in future. Even if we need to change > some internals of org-capture. Over-generalization will put an extra > burden on future maintenance. Np, I understand. Thanks for the answer anyway. Best regards /a