From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oIUCLZDBkGL3vwAAbAwnHQ (envelope-from ) for ; Fri, 27 May 2022 14:18:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iNwPLJDBkGKniwAAG6o9tA (envelope-from ) for ; Fri, 27 May 2022 14:18:24 +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 3140015F0E for ; Fri, 27 May 2022 14:18:24 +0200 (CEST) Received: from localhost ([::1]:60472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuYv9-0006GI-9e for larch@yhetil.org; Fri, 27 May 2022 08:18:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuYuL-0006FR-IV for emacs-orgmode@gnu.org; Fri, 27 May 2022 08:17:33 -0400 Received: from mail-dbaeur03olkn2091.outbound.protection.outlook.com ([40.92.58.91]:60320 helo=EUR03-DBA-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 1nuYuI-0001op-EL for emacs-orgmode@gnu.org; Fri, 27 May 2022 08:17:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NPD8AqGUEdprx4onWF4zLXqY7rYX55PVA90WezKBtiAR7twOJFqm0xUPbipsGJsQfHnk7gPrlWSaRdvZbPNJsaCweDh8hzAmL2lhWl17fpWSmpv0CtVQ875hbQdQXnR9R/aviMUd8+8BX3ymi/KoVbyb7dRa1sDrId6UCgSoLw8nP5yiktx+4aehUKNkm2CMuyw6ncFOQxgGpnnucDtC/EzmVodjJeHslDYuPF8sqFSc1rWNeijlcKFShclGzJaGS8uQ5+In/77vDAytxPSrJ86pX5GjR/o8YptYCN8GROivKAq9GaWPkxhcmvN5+SfhwfeQ1u1mRFky7Dzzo0YQsw== 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=DA+uAmNM0a+XO9bBikBCgcBXCwIFeqrCFJ383MQSIBU=; b=jQV+pRpiyL7UnVkn3LmgNix66bYgpyyFzpSG2h/9Zyhdo5R1e4MSHggpF9ho3xKG0NZ4S30krUrpuJJiepsWYdczQngSye25ahk5XSl9d2Q5gQflqlJBvfdytPaICylDtYtWilcddT5AFxblKIEx0rBlOpPWQu212XZZCX33SbWuW5KIUXveJUibIz69vGoo7bYLJ8/wZJfB1+HRSigZ4dh/95Cdqyo6GotHKHcdVAVIeSpnf3sHkdzeg/a+hK8MmVzomoU76PACMIZB7Kk+aXqUcuQBMResgW0BpESHhlCF2BA0ZDCPEmm9rQzPQ7zAkFgI9X/FJrX0Ljm6ypucKQ== 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=DA+uAmNM0a+XO9bBikBCgcBXCwIFeqrCFJ383MQSIBU=; b=jvnskF1S8XDEKw/s0tJqPEE9U4Toe5Z6uGbJTVV0OG84lyLySVQdpg+St73qjbSsJNAR2ZicV7xdXdCm/+9E9AnDHzjPCDHkXt9VJRwsmKNhFdhG5qSmWfeKNxHs73hcA5qQ+EWGOK4N93m8iiO22N7+qwFzlPyb10i4829kj0ntZufQACFBZ8+xzmk8zLVWvEsjjQoLusD+0OEnb+pqddyFIURddlxMKS8NLFrw9AtCUOju0bKyi5Ds4W2toFOGlhNZj3EH2d0v+DsRGwNEeUfJWFnBoWarAoLsKUs5i8gunqJDXgDBVvPH8yDtO2WmnEohdm2ryFTZFwErbV1z4w== Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by VI1PR09MB4032.eurprd09.prod.outlook.com (2603:10a6:800:12a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Fri, 27 May 2022 12:17:28 +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.015; Fri, 27 May 2022 12:17:27 +0000 From: Arthur Miller To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: Proposal: 'executable' org-capture-templaes References: <87mtf3tui1.fsf@localhost> Date: Fri, 27 May 2022 14:17:25 +0200 In-Reply-To: <87mtf3tui1.fsf@localhost> (Ihor Radchenko's message of "Fri, 27 May 2022 13:27:50 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [tW/7lWLCl44SpUHFP+XxaywAYjYFRoX2] X-ClientProxiedBy: CWLP123CA0144.GBRP123.PROD.OUTLOOK.COM (2603:10a6:401:87::36) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87r14fjhka.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 870dc269-9d1f-4812-9cd8-08da3fdadcaa X-MS-TrafficTypeDiagnostic: VI1PR09MB4032:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q6EWr2JDDjnTjHWgcyT6iMTUvLPcbV3tQ2a5EtcVa5j1Vqb0Eyrn6Pnu7ngf8SIor/YaZ6sENVVsT3xLnLAqjgaup44g7ZBroZFHu7cerP1vtqFFPacLQI+NonOiq4iPaN2/utphiwAgKUYxjKP7VvhN9jLuDk/ry3uMETHcRHLdBqBJxBKs+Mu2kBssFJClU1JaEdTlilUC7Q33IV3aOtbhPPGQG13StsrzEQlM6aK9Sf+Dsdzldaq/R6bH9MbVdziawZdDcMcSSbesybS2nk+eZTJtGDKRgZM3qsdcQcH0zi6KMK3icHExXOGqRYQY2XMZ97H60kFrDrUSqc9A8XsYUyM2JzAK7hhZT8zSqTQasBtxfwwMXaL8uQG1ruRu00fmFpVEaKATr/sUa1uR5wOkcrXLmb7FBvokTlNZcI7wf94Hy++i85hy2VB67O3J2Zxcs4P9n7Cc2yez0t9n4uWI76C9kBrvfyOMau3O5Ap2B6KMJhVH+cIl2IeiWdw1Vp+XLXGphScbWSN25jFGFZ/A98ptc5/rdBlwNGw8h06cV4hB6XI11eP/INah32HwrYtf7+qMHlFDq8Ors2GcRg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5mTL2TcT74Us5D3BB7fa/ywUv//H5Mr8UPz/LESpsnmnjMpr6udpjrK2LRyY?= =?us-ascii?Q?tehxWHTrXw2T9leR553Si0ttWOLCPxNbngf4sjz7gtg4eqXkPARQCUxTEqyz?= =?us-ascii?Q?BufPEL7yndkoSFGAJbuxPhU5K94LlkSd1wcoJgmuiBpnaLi7sWajm/n7bebQ?= =?us-ascii?Q?Q5d5Tglrt+no7Xfa9UOHGxBfb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= =?us-ascii?Q?naZONOC379eZevYKXcMQMxHLs3odMfLiZB5SikF4UvClhffEOd/lf4tAur2/?= =?us-ascii?Q?kHwYJ6n/bZ8b55Pz1fxTfEi5Z61pbzI1kKgJStLOHUr8kb2Hk/uO5yoRUuQn?= =?us-ascii?Q?4898iXA+goIOUEz9/V1uY2WBwtO2Zf+kFj50um+o7pk7F6UyOPatMS2ERt1z?= =?us-ascii?Q?VEUatUqt8qhmxey6hLyewz/7w9MPh4Ej1NKT4VI6P/m3aOqPkgdSOyz9iBty?= =?us-ascii?Q?SyTeRRfwPHTIye8KUBTDd7eMHnE/MoagGm8IsYOU0Wmq6UCyuFeP4YLPLoYM?= =?us-ascii?Q?zOEPR3kqN1y7Yn2pvqsYt7uAsj+TQsCbQyCsm8SVKHIgvJI5TUvliksuTDg/?= =?us-ascii?Q?vOAMDjKJmiU=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 870dc269-9d1f-4812-9cd8-08da3fdadcaa X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2022 12:17:27.8789 (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: VI1PR09MB4032 Received-SPF: pass client-ip=40.92.58.91; envelope-from=arthur.miller@live.com; helo=EUR03-DBA-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_NONE=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=1653653904; 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=DA+uAmNM0a+XO9bBikBCgcBXCwIFeqrCFJ383MQSIBU=; b=EYpEJEZ2kQElglumnEMUR5Ndm0edXT65ttaYqLcT/CrjtUP2b6WGbDDb1eqS2UN7GWtzNf NMxTTPtMmkvyZBthwW59TcwyYfOpO/RPJylq2kIxP7lSXM0NNPZ6pDtTrv2MwgBf3CbI+c KYS+6ZJnOry+oiFjgIEd0a6W3LnWBUrqz/G14qRDqifb161IUQ5DJaV5YueQkA7/NzTVX9 g4yusTI1FhuVzLEz6/jekALUOZ4PF/Z2mOEPP1UXn5I3clh1TLdekwJLis/ECEGPiPwDV8 plmPfqn8Gmx8IGAFN0iFB280h9k/qpcJ8gS2RknoFrKcaL/kYQra9lwtgpaxLg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1653653904; a=rsa-sha256; cv=pass; b=Km1a/lX4DEskw0cvNNAzhQ4apM+zA6UIwHggdVnLpK021c7WdwGOi9N0gXAl6XH9kC61Oi NsLoqV9K8vxyNqBFM0sqGaDljYEJVvmNbN6b39BT7JtmHPXD6Dwv9QxeyXjpSI1DHMTe3A E3nT3O+vbTnXvUijpIeTGJSvk+KOLdaw5z+ArpsLVmGc33Bp0wjwdQhbB5j4h9rMX3QPfk hv4l2/VuCb/2LRvbfLC/HpkYDtljSQxlQ24yQgOY7x31QhwC2UgeSfotzRM1z+Y5Px/5ZW ShUXy647/xFA7+oedUqYs2ovv7kQLF5r4WwMAkETXv/sCIuBQKoOLBcXIjKZRg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=jvnskF1S; 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.85 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=jvnskF1S; 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: 3140015F0E X-Spam-Score: -6.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5KV2zfYuAxMd Ihor Radchenko writes: > Arthur Miller writes: > >> I was playing with org-capture today, and it strike me that it could be used as >> a simple and lightweight alternative to create GUIs for user options, somewhat >> resembling the use of well-known hydra/transient or built-in help macro or easy >> menu. > > Is there any reason why you dislike transient (now part of Emacs core)? It is not about me disliking transient, I am sure it is a great library. It is more about simplicity and efficiency. Entire org-capture is ~2/3 of the size of transient alone, and as an org user I have org-mode loaded almost always, while I don't have transient loaded, since I am using magit very, very rarely, which I believe is the only consumer of transient in my Emacs. So it is more about lightness and efficiency. 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. For the record, there are other alternatives to transient that were already in Emacs for example macro 'make-help-screen', as used in Emacs help, but the complexity is also bigger, I am sure you are aware of it's usage, but for other readers, an example usage is in help.el, starting on line 238, where help menu is built. It is not terribly complicated to use, but it is still more involved then org-capture template would be. Of course, those are more capapble than org-capture, but most often we need just a simple choice. > 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. >> I would like to propose a small 'feature/change' to org-capture templates, to >> inlude a new target: 'exec'. It should be followed by a function to be >> executed. >> >> I believe that this is a simple change that does not intrude on anything else in >> org-capture, you can see the attached patch. The goal is to just circumwent the >> createion of capture buffer, bookmark and other processing done by org-capture >> etc. However there might be things I am not aware of, so if someone have more >> insight, it is welcomed to hear. > > 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 :). > 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. > already have transient achieving the same goal. Yes, and other alternatives, but to higher cost mentally and computationally. I just wish to use org-capture for its simplicity and lighntess. Considering it's five lines of code, and no additional learning required to use it, I think it is rather "cheap". We also had easy-menu and make-help-screen when we got org-capture and transient. I can still understand the feeling that it is "out of scope", but I don't think it is terribly out of org-capture waters. Anyway, it is a proposal, and if you don't want it in org it is OK. I personally think it could make life simpler in cases people need a simple choice menus to fire up an action, and it comes with very small cost. best regards /arthur