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 ms5.migadu.com with LMTPS id OArOF2KckWK9IAAAbAwnHQ (envelope-from ) for ; Sat, 28 May 2022 05:52:02 +0200 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 uOqzF2KckWK/GgEAauVa8A (envelope-from ) for ; Sat, 28 May 2022 05:52:02 +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 08F4E2014D for ; Sat, 28 May 2022 05:52:00 +0200 (CEST) Received: from localhost ([::1]:55248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nunUd-0008Nr-Gw for larch@yhetil.org; Fri, 27 May 2022 23:51:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nunU1-0008NU-FS for emacs-orgmode@gnu.org; Fri, 27 May 2022 23:51:21 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:52979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nunTz-00061a-EL for emacs-orgmode@gnu.org; Fri, 27 May 2022 23:51:21 -0400 Received: by mail-pj1-x1031.google.com with SMTP id x17so213249pjt.2 for ; Fri, 27 May 2022 20:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=KRGDNLADvqmq+2kPwNnjRM8plu8SxXPhkO+dYaV90TQ=; b=O6iCYTptMdy2LCVY4U5m0KS77PVAfeO0m8jZK2GHS0YSEiVWW/Em/n9UOV1mHpgQ/1 Nx+g5BBQGWp+ltUb4Z8dUj23BkCGhHu9+qHetSUYoH7bCqQ66eRTtJOj8tuxXD6v6eGF orrw2qVTueqD5QMN20Ne2/v3pEK9Pmw7fu3rngpEFTfhvIe03mqn5PU+xwZqiKqk/iw1 NrOawgJpaKVKuXkI79Z46WZJEGPQo4LnPgeJkIgisEv2//HggUpg56+bLLS8s5sEMYx2 Q1HkMTSwvuQVGQZ5tic9Czfil6cYnzPR12VFvDHQAkwCvpYeEzKkrh2Cc6b/IiUxabP+ m3FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=KRGDNLADvqmq+2kPwNnjRM8plu8SxXPhkO+dYaV90TQ=; b=HwyPs09+5D/m5SnzsYsQjUuBuiN/W/La38/esW/Fj5KTZP3zeoZbYjNS6MHzSsTYPx ULtdFrlt2dM2zrprhxxz6rGmTGsGd5mAYr9hMtk43tKygw+SjzuLf9wVwz5w5qiePvx2 7zRQKV6FEyRl7htJbLEvNx+2UNoA4PxIoDZkmyy+IQ4OYYsuuQp9E3c3sMaOVhPcPD2L +nDfnVxa/loKGPU0rEAxD4MhyilD57gqlEYOjVJoWtGtlroPgAHkb3IWzHvsI5q5ojdD KtUnKi0FTRqzogZzVae01CtoHZChfF2EIE4pKNEYMsAm97HIlYclESNtlCq7sa/4pRJb XHng== X-Gm-Message-State: AOAM531RcVTdXTKkq2xvQ2ZQhup4FEOfJiwUsSSlfAEC/BAO8QDYAzfa pqwvjBfSEUItFMi6Y+M6MLU= X-Google-Smtp-Source: ABdhPJyTuzwd9GAVoGKSv8lKZJSqYkMR5VXopuwxMXSC3fjhRpmn+/IXCBReL5MpdDcfKyc/OC9exQ== X-Received: by 2002:a17:902:ecc3:b0:161:eda6:1e8d with SMTP id a3-20020a170902ecc300b00161eda61e8dmr39873922plh.108.1653709877933; Fri, 27 May 2022 20:51:17 -0700 (PDT) Received: from localhost ([64.32.23.62]) by smtp.gmail.com with ESMTPSA id hg22-20020a17090b301600b001d97fc5a544sm2336708pjb.2.2022.05.27.20.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 20:51:17 -0700 (PDT) From: Ihor Radchenko To: Arthur Miller Cc: emacs-orgmode@gnu.org Subject: Re: Proposal: 'executable' org-capture-templaes In-Reply-To: References: <87mtf3tui1.fsf@localhost> Date: Sat, 28 May 2022 11:51:58 +0800 Message-ID: <87pmjyco0x.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1031.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653709921; 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=KRGDNLADvqmq+2kPwNnjRM8plu8SxXPhkO+dYaV90TQ=; b=eD2mcKSwOgf5f1ti6C4JMpNKRogexb3vBZ5znVF39j1mZIYPvOXDe2cjC+WqvLgHec6/YY 4tdfk3+l+xs3N7U66oYcWaBBP/usBnF4EVovzqQjhL5SiBMHZkX53imTxKwUeJfNAu9iW7 FlmgDs7nNpNFTi73yhhDMOBOi2lKcKaLulqONWN58WRAvjRQrcpb3kbEO+sZ48x2uyGcoW WM8vAmdgbDtBfKg7SoJwmzqtpvoxrm+/TwPfXGd06ce6Y3L2mN3PMK9hb60Zq/kyfGrOx2 nDrLkkrCxfzptc2enBxK5KbYhD3z/T+uHo2K2xnpnPkpZfngd4SY/1stCfLatw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653709921; a=rsa-sha256; cv=none; b=kAzd7w8/fnQVM+V8yomJ6hr9oThrfyFgxxEh3czKPJIHTFvvPcAlah244L0uEjAT6RfI4l JTe4Jos+/Vo+MoLHf8YzL85T6X1mCK3Tef7cpGmW+azvL31bWt48vOX97tHx2MBxfrhaFZ B5icADqKJ+54WiHFK9xU85TAkcR8vGrW7R2wlzJ0mrIFSCQ1+H2WjZExkwAMdQ0nY5N0So w0MsjwxkL0OZXn9Ki3XHpIumASWGM0/ioIhVI/e6FYuKJpVzS5y16njUFW01msWPyoFL6h Rms9Fv15fda224vfPAFM6DNlTbkYyYgaxLQ0XnFhUV8EeN5ORUhXSB89I1RJXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O6iCYTpt; dmarc=pass (policy=none) header.from=gmail.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: -4.34 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O6iCYTpt; dmarc=pass (policy=none) header.from=gmail.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: 08F4E2014D X-Spam-Score: -4.34 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8uECylT+R9v0 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 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. >> 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. >> 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. Best, Ihor