From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MEXuLViUT2CofwAA0tVLHw (envelope-from ) for ; Mon, 15 Mar 2021 17:07:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id QPOxKViUT2B3RgAAbx9fmQ (envelope-from ) for ; Mon, 15 Mar 2021 17:07:36 +0000 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 2D91D8AC3 for ; Mon, 15 Mar 2021 18:07:36 +0100 (CET) Received: from localhost ([::1]:35266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLqgo-0001Zj-Gm for larch@yhetil.org; Mon, 15 Mar 2021 13:07:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLqdc-0000rR-Qs; Mon, 15 Mar 2021 13:04:16 -0400 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:44001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLqda-00018K-KE; Mon, 15 Mar 2021 13:04:16 -0400 Received: by mail-qk1-x72e.google.com with SMTP id b130so32346238qkc.10; Mon, 15 Mar 2021 10:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=FkxknshKhuSiqgjpIY8n1DMc54Sfz3BK4b3UbWsjsRA=; b=YXTlTO3E8vbA+fKpooAQRfdTCJ/pBXsNcJBakMvovQJowAtFbhdzqyCNox7zSsA/cm 7imWw2oRzQOBEIg9dsu/MzKlth9Z2rYfxeQ1vWDrDcc7AfBWhKX2l0JpZ+8grZIMBAc3 NINh2G4ceb5z4b94g5eMmzwYaLxB209rFrBZ6ZlHuaZVUJFQZVvl5RqvfR2EW3jTKSbp yUgUIZz0xYL4jJm0XxOxlBOYCJHRjb/CBWdLLiBkqW2dJEvFMVFcBCmnhJ3efZjLLifp dEcmIP3VTdLlQIHis94iBo5OrDRAjscSabp1/hpqsS6Tuv8VAaKx2WF9sLM7tLjjrfd+ fI0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=FkxknshKhuSiqgjpIY8n1DMc54Sfz3BK4b3UbWsjsRA=; b=soJ3nlgIbX2u0IXT8oK1P81OFJEIyOkmty85/LDbmJXtl1NE1fED7XNH/5tBrLa9Zt Sq32L5rzA2ewDx8Apw3bCo5LILHbGyXKU6ExOntoxfVThXQyJvZBoYeILTHxVE6gx4hk fZCawqaBBR4aCyp3GQv17FOuqLAva+vKRIPMtS6xpzahDhH+I8x1mQGuPEPpAkaJIvv3 dqhgWFryGjtO3CuZDaIrxuptP1iQp5yYu2DHCa+gHnzlabAAy6/U/u0OLuhdBsMlM/4b L6NOfDAaPKJOmN34ap6cdkAINtQgzcT6j3jgd1TlGMrQpe+Cff2U28l7oNUDfmSy5fDk frbQ== X-Gm-Message-State: AOAM533R6XOUr8KO1Q5DQ0/qveXugT+6IEfAjt+KeJ6wjv2JE+itChdv gRzFevy2NT1G5qN80ZqTVNOmE72eoR8= X-Google-Smtp-Source: ABdhPJx3LqMm7isps6FoLWRrfCJHK1TIAmjnMB5/5CuFVr49Q/DtFLbeejC323BvJTDvrDncYOVEcA== X-Received: by 2002:a05:620a:55d:: with SMTP id o29mr18818969qko.253.1615827846126; Mon, 15 Mar 2021 10:04:06 -0700 (PDT) Received: from arch ([2601:8b:c300:1024:1266:d0ff:1635:f964]) by smtp.gmail.com with ESMTPSA id x36sm11721274qte.1.2021.03.15.10.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 10:04:05 -0700 (PDT) References: User-agent: mu4e 1.5.9; emacs 28.0.50 From: No Wayman To: emacs-orgmode@gnu.org Cc: emacs-orgmode-request@gnu.org Subject: Re: org-capture: question about function to create template Date: Mon, 15 Mar 2021 12:57:15 -0400 In-reply-to: Message-ID: <87wnu8s60r.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=2607:f8b0:4864:20::72e; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qk1-x72e.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615828056; 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=FkxknshKhuSiqgjpIY8n1DMc54Sfz3BK4b3UbWsjsRA=; b=QL5846N+DOgNgVgQg8xemxfJ+8E8T/8U9W7BmyXk4vikTJOuLoV5gjtmcYxOr0a/9zUOi7 OwGMsY6EpxYH68FGGFW1i2x9dIowlz5jLLlFoFQvEP1bQyH7vY9M4KaSVSSLEVzliajp9E M2C8KxlqqUe4nbml0+uG9UAZexRC2OCnkDVwNjD4fuNFCsjh9GIIGfMJ1WBbWe3BL7PNYJ LG5WKbYDmFaBKeuXThdaxzrbrI4s3YQj8jGHX598gYcERdfUC+Z/C2YcHvkxmjJxC87lV1 LZqFpYeE4zsnUCb1K/eYsRATFQwTtQlGKcCcZAeqqmuXzHx8XQ5/oTM2u3VyCg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615828056; a=rsa-sha256; cv=none; b=Ji6z8MGrOMmZxCdysFHK2+i3Mow6iWfPGFP+yznvq+Uyfcnmb+USqSmXfv1v7ZvYDf8VQH xmWEwmhQFGjdRLMYsZqtWq8vVZC50puBMeLfUzkleysWApCZjORTegbV2mtXjYjGEBr50q lN63AC4MrFmjBBO993KlJ8nTk0/Wugymhm4MI3lD4c9T81HXKiEpPDkigB//nOgUmfTpen ZXfhzxVeHybcsWC3tz/T3iK9E7fU2cH7tbZE34yW6PAzwzC2UpKFML1Z49aVtScCojBnHS YIxWmMWS3zuFuQhURBOV6p0oZAFCLD5UFWOLcx9Vx4BiVqGk3/UvEtI8rGJN6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=YXTlTO3E; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=YXTlTO3E; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 2D91D8AC3 X-Spam-Score: -3.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7/VmeQsHo3Rv > From: Joost Kremers > To: emacs-orgmode@gnu.org > Subject: org-capture: question about function to create template > Message-ID: <87eeggh0r5.fsf@fastmail.fm> > Content-Type: text/plain > > Hi list, > > I've been looking at the =org-capture= mechanism a bit more > closely recently and > noticed that in =org-capture-templates=, the template can also > be a function. > This looks like a potentially useful feature, but I was > wondering if there's any > way for this function to access the state of the ongoing capture > process. The metadata for the template is stored in the `org-capture-plist' variable. > Specifically, it would be useful for me if the function can find > out the key of > the template that the user selected. This is stored on the above plist as :key. There are some corner cases to consider if you have overlapping capture processes. You'll want to look into `org-capture-get' and `org-capture-current-plist' as well. Depending on your needs you may find DOCT useful: https://www.github.com/progfolio/doct