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 IPP5Bsct62JCKwAAbAwnHQ (envelope-from ) for ; Thu, 04 Aug 2022 04:24:07 +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 QFcgB8ct62ID6gAA9RJhRA (envelope-from ) for ; Thu, 04 Aug 2022 04:24:07 +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 98B3A204C7 for ; Thu, 4 Aug 2022 04:24:06 +0200 (CEST) Received: from localhost ([::1]:51348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJQWr-0006Zy-F0 for larch@yhetil.org; Wed, 03 Aug 2022 22:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJQWF-0006Zp-3w for emacs-orgmode@gnu.org; Wed, 03 Aug 2022 22:23:27 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:36784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJQWD-0007gb-Cp for emacs-orgmode@gnu.org; Wed, 03 Aug 2022 22:23:26 -0400 Received: by mail-pj1-x102b.google.com with SMTP id 15-20020a17090a098f00b001f305b453feso3869954pjo.1 for ; Wed, 03 Aug 2022 19:23:25 -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=6DFurCKdCeQ1GMnqYlezzqN3HVsPDlO534rrAy55dVc=; b=UQxS+ofFZqgYKf5PcnrFTOcT91TjJLkHM+9AL15jVGocI6doHMxxHeoIShf3+OH1jB wGUmZDnbAaUu952JS+CTEfceK6g9nxB+S6PzhRDIAGzaq44tVEXefuhGHlROjHb3lCkv FrwKJDm61/j/4GYWOrsEVe3nwz59i4laEgFj1HkWo3X3RhtBbBjjHPeZOziZVf+f36yv K4O6gG34abZHy/8gRi8TqBrSr/0kzM0ZLFJcr7Zw5411haZWTqiJ6bZ7ho2TDZamQsgB Ty+8wyDEkHreske8HGlYryNwj0edZQZ6Ssc01a/EfDkt4iO5aiZYCbg5QUBSngg2lhU5 jXyw== 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=6DFurCKdCeQ1GMnqYlezzqN3HVsPDlO534rrAy55dVc=; b=zdipvHv/eh5eLxeA8Hx/G6QV8cTw4R2tRlEHjSdMzschdmTSGlGQkrT0v6LzjDW59c 5oGj8hMJzD4j5WUopzsPhm5B+F+aHQHLiHWEvMv5jA3yL7e4BvKo+iKvPZ0ehiT9jkp9 QuQx+QJky2yR8q/JgQmv7+d9GxgQ6z2JFALgbTm9tADda4AGo/0l8lrmzqQ0WfkbiaNT vf4nO+78AwBtGtm1ah9XUliOPQyCraBk5YYDLvTv94p/RGu+s8zZFfGBzlbLiJlJ1OO4 6NsOpSyFAt9tm6YhvY7s6mpDJCu8LvRVqFsMw4jzaIztrj/bTUCCtV4x3X7i3uPtkTHL MTlw== X-Gm-Message-State: ACgBeo3qmnFX8M7kb2D/wfi0jv9Zax+1BUOBNN0F+fn0zjfplsp+pM+B QjLrU2LnPZbTxsDcjohJAwZEloI/b65iHQ== X-Google-Smtp-Source: AA6agR45Ols3cNG+tuxD3BGDhdV8KMm3QT0gjJHRKapIECRRcvIeM/dwRADiC9OYq7zt+0g3qiITJw== X-Received: by 2002:a17:90b:4c8c:b0:1f4:f6e8:2de0 with SMTP id my12-20020a17090b4c8c00b001f4f6e82de0mr7878010pjb.36.1659579803329; Wed, 03 Aug 2022 19:23:23 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id y78-20020a626451000000b0052d82ce65a9sm7354593pfb.143.2022.08.03.19.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 19:23:22 -0700 (PDT) From: Ihor Radchenko To: Jack Kamm Cc: emacs-orgmode@gnu.org Subject: Re: Bug? org-id-find not finding some IDs In-Reply-To: <87r11zifjy.fsf@gmail.com> References: <87r11zifjy.fsf@gmail.com> Date: Thu, 04 Aug 2022 10:24:29 +0800 Message-ID: <87v8r8hhk2.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102b.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=1659579846; 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=6DFurCKdCeQ1GMnqYlezzqN3HVsPDlO534rrAy55dVc=; b=bjZejR783mwlG4GCAlDjxLMll+O+RgxSONfOuEsmjrPWGNq4hTe4r+m6vmr/ncNg63nfzw +PCbOuRdwTWPcvCwp2sFTtSv8Rd5qdITjfWf2l9L/73Xby4rxZr+FB4RIqBiOZk8+HSwjs VrTUMG9mAd6uOS4vVZ30+OFJhtx/u/VHeB2WHAtHUu65qkggxUUB5DJwevHfxQeI+UCxBE O4cR86TsQ2FMl6K1klNsmYjKlxRp2BOYAwuOwNwGGsTRWriBlSp2uRU1ORkeFlbmSGaK8m hEF4ou9ujc6OkNJnan9jp/ChBist4klnueXvNuybqrgcecsP5057bbvciWjj/A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659579846; a=rsa-sha256; cv=none; b=pGO2wPRBOc5YnuYKa/7o1BdBL7skMS4P64BuEHkrrRK6BA/91yBpalsUtCVMDfSkYBbH1w E++tAQmbhyE1bde3uSQ5aX8qlsvbMUrCInxa7hQVe2XKQvoA/Mql3EdvQUSyrMvQ+kvFzl 3l06WQZEETQrd8M5ENw2p1oEKMkzpidCnZZnCn3n8K2WdeyijQH9YY2beC9NIWdKoWjDZN BiX5Rbe6E6SgJlSihqKo44IptvhoKDJpG2O0bWQndNNlwMpWBGui/LgTHAKaI2F12+h/Zy RasVeO9la4zLe2KR4t2jXqWQB39PdL+QtNY9DMcZqmT5xJ5Xth2L170p4lOrEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UQxS+ofF; 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: -1.91 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UQxS+ofF; 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: 98B3A204C7 X-Spam-Score: -1.91 X-Migadu-Scanner: scn0.migadu.com X-TUID: fszQKmcMI1D2 --=-=-= Content-Type: text/plain Jack Kamm writes: > For a minimal example, put the following in test.org: > >> * Headline 1 >> :PROPERTIES: >> :ID: b1569c92-3872-4ab9-80eb-274c4950991e >> :END: > > Then: > > 1. emacs -Q test.org > 2. C-x b *scratch* > 3. M-: (org-id-find "b1569c92-3872-4ab9-80eb-274c4950991e") > > Which returns nil. Also, "C-h v org-id-files" doesn't contain > test.org. This is indeed inconsistent. The current behaviour is to scan only files where it is known that IDs are present. Can you try the attached patch? Best, Ihor --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-id-update-locations-Scan-all-the-open-Org-buffer.patch >From 5d166219c9af1f34dccebac55249db926fcfbbe1 Mon Sep 17 00:00:00 2001 Message-Id: <5d166219c9af1f34dccebac55249db926fcfbbe1.1659579786.git.yantar92@gmail.com> From: Ihor Radchenko Date: Thu, 4 Aug 2022 10:21:59 +0800 Subject: [PATCH] org-id-update-locations: Scan all the open Org buffers * lisp/org-id.el (org-id-update-id-locations): Always scan all the open Org file buffers for IDs. Fixes https://orgmode.org/list/87r11zifjy.fsf@gmail.com --- lisp/org-id.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-id.el b/lisp/org-id.el index f54e7280a..fe2f5f328 100644 --- a/lisp/org-id.el +++ b/lisp/org-id.el @@ -491,8 +491,8 @@ (defun org-id-decode (id) (defun org-id-update-id-locations (&optional files silent) "Scan relevant files for IDs. Store the relation between files and corresponding IDs. -This will scan all agenda files, all associated archives, and all -files currently mentioned in `org-id-locations'. +This will scan all agenda files, all associated archives, all open Org +files, and all files currently mentioned in `org-id-locations'. When FILES is given, scan also these files. If SILENT is non-nil, messages are suppressed." (interactive) @@ -515,6 +515,8 @@ (defun org-id-update-id-locations (&optional files silent) org-id-extra-files) ;; All files known to have IDs. org-id-files + ;; All Org files open in Emacs. + (mapcar #'buffer-file-name (org-buffer-list 'files t)) ;; Additional files from function call. files))))) (nfiles (length files)) -- 2.35.1 --=-=-=--