From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qLZ8JLlQl19FaQAA0tVLHw (envelope-from ) for ; Mon, 26 Oct 2020 22:42:01 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QGVYILlQl1/xPgAAB5/wlQ (envelope-from ) for ; Mon, 26 Oct 2020 22:42:01 +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 157E29400BF for ; Mon, 26 Oct 2020 22:42:00 +0000 (UTC) Received: from localhost ([::1]:33776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXBBf-0008Ql-Q8 for larch@yhetil.org; Mon, 26 Oct 2020 18:41:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXBA0-0008MA-3w for emacs-orgmode@gnu.org; Mon, 26 Oct 2020 18:40:16 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:34815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXB9y-0002K0-6X for emacs-orgmode@gnu.org; Mon, 26 Oct 2020 18:40:15 -0400 Received: by mail-qv1-xf35.google.com with SMTP id g13so5151447qvu.1 for ; Mon, 26 Oct 2020 15:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=69SMZV/hJC0IL6/4mIDzBfVJCTUpb7gmTcDFsNgxpc8=; b=fk/7eaoao/j4bBRmrSB/uHc4G1meCa5SVRTLHd0rt2/BUBF26aMSAyCjx7qrWyJEvm m5Nk2dgCjfrOhKC+K+8fs4FyxxNDndAX5Ex0y1ziFBs3doEd22ni85r4DS8AjAJzXbte 0jE18UTunpu6vXFyF7SQRfK5MnlkNsTSp4l30JUHP8mVngLeEHTO7+eTizSv2d+KNSc5 njxv5y4PewrEjPpghVIjdGOYG20WyVm7nP7o0vWD+Sora71ER4KwdTLQA8wqN5fhUhed iXaWm60TA/LPsmS4gMPM9/HeThPhdUHmtvs09jxWExNwhFIh5YRRW6p2UtH3clWqvZPQ iTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=69SMZV/hJC0IL6/4mIDzBfVJCTUpb7gmTcDFsNgxpc8=; b=TD9IQ8/pQOW++ckus8oqUI1FjwjhgycB2OIa1XXAh7w+9RJTASKapmaAL4KbkbhZST T6XlHUDuGa+C5lJkF0++YSwgFU1Bqb4eC9ElKGBcahVsNC6q0mD5q3tQypB40skPFljA 5VRpBVn2KBLKov6mMu0IqHI/C8JmgkN1R18boJuD0MplxVmZatmiRAiot1Cmc1Gl1lxn Ygn+kx8tkecfaC0kdayJ45nj6DI1HGO9RFaAZfvWaAsUdutqjQJbfB5/tyUhlDq6GIeN kmfTUWTDhB4TfZgAZW+8beaSXuHxGeeIvvloxur9fqVPO+TOD1W+TTA5cLHEyQLYWARz DmUQ== X-Gm-Message-State: AOAM531NonCUW84lBI07ApC/t6KVdAJk66jTKeLabhUFw9Po038GkaZY /UKHgjntwfYFJSJvOz2dLSb2U3LbK3btOQ== X-Google-Smtp-Source: ABdhPJwd/hoZKf4YY9plvLMmmsn/BGKH/lyZ/i7FpsRpfuF1G6X43tvsbKkPpxSkWHUPBnCAsRMj0g== X-Received: by 2002:ad4:4e0a:: with SMTP id dl10mr15952453qvb.41.1603752012749; Mon, 26 Oct 2020 15:40:12 -0700 (PDT) Received: from gusbrs-laptop (189.27.5.61.dynamic.adsl.gvt.net.br. [189.27.5.61]) by smtp.gmail.com with ESMTPSA id c206sm7506046qkg.106.2020.10.26.15.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 15:40:12 -0700 (PDT) From: Gustavo Barros To: Michael Heerdegen Subject: Re: Force creation of org id in template In-Reply-To: <87lffswu33.fsf@web.de> (Michael Heerdegen's message of "Mon, 26 Oct 2020 22:33:36 +0100") References: <87y2jsx2qz.fsf@web.de> <87pn54kcys.fsf@gmail.com> <87lffswu33.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Mon, 26 Oct 2020 19:40:08 -0300 Message-ID: <87sga0lign.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=gtvbrs@gmail.com; helo=mail-qv1-xf35.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=fk/7eaoa; 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-Spam-Score: -1.71 X-TUID: aJwrBR6pBR21 On Mon, 26 Oct 2020 at 22:33, Michael Heerdegen wrote: > I'm not sure. I see that creating an id involves slightly more than > adding the property - see the `org-id-add-location' call in > `org-id-get'. Calling the higher level `org-id-get' or the like in a > %() spec in a template fails however, since when it's called a temp > buffer not associated with a file is current. > > And then I'm also not sure if the above is always secure when something > else in the template spec wants to add a (different) property. Do you > know? Not really. `org-id' usually "just works" for me, so I never had to dig anything deeper there. But, as far as I recall, this is meant to add the new ID on the IDs file. Considering your capture template is likely to be on your agenda files, this is probably not going to be of concern (meaning here these files will eventually be scanned and the ID found). But, if it is, you could then go with `%(org-id-get nil t)`, right? It does seem to be more appropriate either way, I agree. I have stored here in my init file a message from the list describing the procedure Org uses to try to find an ID, you might find it useful: https://lists.gnu.org/archive/html/emacs-orgmode/2009-11/msg01195.html Regarding the second issue, of course, you should end up with a single properties drawer, and the template should ensure that. Best, Gustavo.