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 8JaiOlVdl1/UYQAA0tVLHw (envelope-from ) for ; Mon, 26 Oct 2020 23:35:49 +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 8OduNlVdl1/NYQAAB5/wlQ (envelope-from ) for ; Mon, 26 Oct 2020 23:35:49 +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 55F9194023C for ; Mon, 26 Oct 2020 23:35:49 +0000 (UTC) Received: from localhost ([::1]:38224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXC1i-0001TY-RS for larch@yhetil.org; Mon, 26 Oct 2020 19:35:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXBx0-0004L3-UM for emacs-orgmode@gnu.org; Mon, 26 Oct 2020 19:30:54 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:37561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXBwz-0000UY-6a for emacs-orgmode@gnu.org; Mon, 26 Oct 2020 19:30:54 -0400 Received: by mail-qk1-x742.google.com with SMTP id z6so10149235qkz.4 for ; Mon, 26 Oct 2020 16:30:52 -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=tDzkg5pViRddXMugiTcCrxHQgI4YAbYFPP5HgQszYpY=; b=b90LuvXfAQpJWabrptoOGYgWs3T5QKi6zI1I10h86CKTujTw+trymDXQycitb7y66Z oHTMdpRZqizvA3K4UCd/baTX1qjWLzvgUt/3aJLY6xm8NBgS5DntbpFiM2oAlep2yWhy WCPlHoBcXcIib9R/wjaQmdiiKRw162tawfSPzGgJ+mycqWMXvSWIErBwYzXU/rBkNqlS gnWNI44cD8H+e1UKGD+b1tN3alcHJqBc0uF4Ij1l+9GKdAR4nvvEn3Me59GJrdU1ve0G kCGY/+ByBlmM9y4cKgNGr04pnj7x+eMzKWREm2jiLcP8CSPclRJL8/X93mUW2WINTkPJ nTBQ== 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=tDzkg5pViRddXMugiTcCrxHQgI4YAbYFPP5HgQszYpY=; b=JX2QBW7bmietNYAnHILwSZm6quYX44rqcs893qFnMRP16f0xb0wzvyrbHLxUScY2Ak pl/2NXAv0FcrSiAlxl9sIMAYzdW9C4JgZc2iMPUFFYzwhU1cj9Wi4GhlOMTJBqFJao7C RmGE/xHN/rUzaivv5LPX8bnxmmT3qlsTGFOSUrpi8poCvqATUJy4lX3Zc/RLy8pxVyGF HGlALqk27ByHtd+6DbN9hIo/HFdZLKR+EXgzjYuQw5IFhcz8Yi0t51Bjatord3v2NS+w eYyyAjuSTXeJRsLmgkz9B5XlO2d5Yjy1SfYzjLavtxLHg1259qbkD4IOEGlM5DML1nm5 rgwQ== X-Gm-Message-State: AOAM531lvCfSYFQggb3XP55nE5yqT3xBtjccC20UaMR/oYg2ShjpnVCY UoNAO9tKYQ57VG9kdHMephLa1aKhxW5nOQ== X-Google-Smtp-Source: ABdhPJzLfoA6F6dHh0vxDdelL+7AP7Rw2WLUJ/qYvYc/5j4O1KBmrGGhJuO9gLztHLaD5jtcuJaufQ== X-Received: by 2002:a37:a8a:: with SMTP id 132mr20421219qkk.199.1603755051935; Mon, 26 Oct 2020 16:30:51 -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 t9sm7628176qkt.49.2020.10.26.16.30.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 16:30:51 -0700 (PDT) From: Gustavo Barros To: Michael Heerdegen Subject: Re: Force creation of org id in template In-Reply-To: <87sga0lign.fsf@gmail.com> (Gustavo Barros's message of "Mon, 26 Oct 2020 19:40:08 -0300") References: <87y2jsx2qz.fsf@web.de> <87pn54kcys.fsf@gmail.com> <87lffswu33.fsf@web.de> <87sga0lign.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Mon, 26 Oct 2020 20:30:48 -0300 Message-ID: <87mu08lg47.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::742; envelope-from=gtvbrs@gmail.com; helo=mail-qk1-x742.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=b90LuvXf; 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: En35OwJO9b4S On Mon, 26 Oct 2020 at 19:40, Gustavo Barros wrote: > 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. Indeed, `%(org-id-get nil t)` fails. But the following works: (defun org-id-get-new-id () (interactive) (let ((id (org-id-get nil t))) id)) To my surprise, I had to make it interactive. Perhaps that's what made the previous try fail. Best, Gustavo.