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 +O1jMxVHlmKjaQEAbAwnHQ (envelope-from ) for ; Tue, 31 May 2022 18:49:25 +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 OCVgMxVHlmIpNQEA9RJhRA (envelope-from ) for ; Tue, 31 May 2022 18:49:25 +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 64C223B149 for ; Tue, 31 May 2022 18:49:25 +0200 (CEST) Received: from localhost ([::1]:38500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nw53c-0004HE-DW for larch@yhetil.org; Tue, 31 May 2022 12:49:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nw4s5-0007yd-OD for emacs-orgmode@gnu.org; Tue, 31 May 2022 12:37:29 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:41699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nw4s1-0006o0-1n for emacs-orgmode@gnu.org; Tue, 31 May 2022 12:37:29 -0400 Received: by mail-lf1-x134.google.com with SMTP id v8so22370663lfd.8 for ; Tue, 31 May 2022 09:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=bQf6r0YK8KlmeTcFjqTwdJBHsZ2b+b93iR3gUt8Lz6M=; b=GTIZBSIVI+vqy3Fav1QO1pHeQnK9EwZHZgIczPPf6agesn01gy8KcOs59SCU1zT6mm R66nBEA8wcLwtSWONZ4x37sMUkDBsQBk69jlxpW1EukwCY/6Ka7Y8stMqIVaQqCwqgec QznRO63u4IxAiobr/Il9lwpmBH7HdMhdQ3m9fb+B3+fY2M/G8sywUayQrYr9d5/pO46o GWzuwnramdCtJ1mQIEzHjGO0BEIos2nyGIsZOo610BhBKRyye/un6fr96jVIGA95XptT TRW5T2s9efVpcvyR+B77mAAJHRw+muVgT+yUMv77cYQEHq8sthLARuhaud5WWkfV9oCs X8bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=bQf6r0YK8KlmeTcFjqTwdJBHsZ2b+b93iR3gUt8Lz6M=; b=PlulB0E1NRRarNUULLQ2kjbTfUVVi1M4komdu4imBCWyFCRMV+O6fSTX5dpRRD0wbz n7lbRyNVdtk6GM0/2m/4gd4s1ezFmoHLgau/8zNZgqWoBMRpc1DNYtvqCbfR8wUHKnwP 9vED8YurGbpwrdz2rmuAOhNHT3gWIJ2jaU+7Wsuww+mIchczbHlZ5zjSzYodekLpZxu9 TYZzwDMVqODQP8oNjqGe0JEGad48i/GHI+CzunSS3f5Zg+ay3Ly+v5Nz+4v1fXypvb+p iADmV6/IIbvfRpE1/fVh4SuCNCeHimBEik6kO+zwAX1PYka/4KhWC/oMkGacUg5mOvO1 /h9w== X-Gm-Message-State: AOAM5318glUu8Pt3eBhrAe717VKCZtdKAOp7er1aih+KyljJeNQ2Wdqc 9+SnIGi7q5/YlWu76l1tEf3mcHcXhOaIlqSk X-Google-Smtp-Source: ABdhPJzduYkauIQzoTgP2yKJfv9JT8VRqvq99ZTLecyKljfYAkxy0/Dd1BAQ8elvLdep27BEvBAeDg== X-Received: by 2002:a05:6512:c08:b0:478:6a03:2209 with SMTP id z8-20020a0565120c0800b004786a032209mr33164968lfu.21.1654015043268; Tue, 31 May 2022 09:37:23 -0700 (PDT) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id k9-20020a2eb749000000b00253deeaeb3dsm3206900ljo.131.2022.05.31.09.37.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 09:37:22 -0700 (PDT) Message-ID: Date: Tue, 31 May 2022 23:37:21 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: Proposal: 'executable' org-capture-templaes Content-Language: en-US To: Arthur Miller Cc: emacs-orgmode@gnu.org References: <87mtf3tui1.fsf@localhost> <87pmjyco0x.fsf@localhost> From: Max Nikulin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=manikulin@gmail.com; helo=mail-lf1-x134.google.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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=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=1654015765; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=bQf6r0YK8KlmeTcFjqTwdJBHsZ2b+b93iR3gUt8Lz6M=; b=aJ+6afRD/liQVhho1tGBCTc5fp1m7CwE/1eVabHVck0M1x5TgUmxpfLFMetMrFmlXiMc1Q KQ7A5fek2eh883bpCFsS1wJ9Lb8YFgofSnGBiYJOa8mQKQ/yuK23VdzWxiJGGSqvX7ojuW w3SuX594DJYcL5SUWVwJXnhTAA0dZ8oqVK4oJ4L1LbQz9iuqnchE1S+KllljELsIwbMqXm +8Sjd+V3llgSpKFugOOkqXzvFZM0pd8rk2tqcZPvUg4ozqZwnMt6WlgAgQzCSWBdBvoJ1S dcwpaglaixZjSx95kvL+EW/k3doBV9PV5F+Ov4oi8SfoNcPWKN6Ckfk/db5zgA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654015765; a=rsa-sha256; cv=none; b=gNWvEe/hjuKp392MWLxO+ZVG1m1GvbK4nwSdJjP/lYD6LzkEB1DPXUpWkCa2nFOAlbJGP5 mmLzTHWYXGZ0E/HDw+lkEAoEMPR+GSQ3xG4PdqERNeDOoJhJBIKtcqH7wPO0nCFlOajSbi B13OjxfJBnaHrmknlgRDjfaAa//lwMqgUtyZJAtzQIoYsAYHjh8OshMMmrOkZcBY17itIU g6m2blEosOAvEIv+OhyvomWcJMFNYt+Hnk2Jtr6n0WfPKbEcZJNAMbPBENks5CgGlvnXE2 ySYy0V36ai1ORq4FgquO1Eia+X+J1ILUsaWHGf/YIhZLfTGGEyfOOuqLYkrkbw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GTIZBSIV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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.16 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GTIZBSIV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 64C223B149 X-Spam-Score: 6.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: xAQxsFRwsu49 On 30/05/2022 09:04, Arthur Miller wrote: > 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 () ...)) >>> ... >>> ) > > I am not really familiar with those other dialogues but org-capture, so I only > had that one in the mind. There is `org-insert-structure-template' C-c C-, Doesn't the following code do what you are asking for? (let ((entry (org-mks `(("a" "A entry" ,#'identity) ("b" "B entry" ,(lambda (x) (* 2 x)))) "A or B"))) (funcall (nth 2 entry) 10))