From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id ENqzNP26+mXbJQEAe85BDQ:P1 (envelope-from ) for ; Wed, 20 Mar 2024 11:31:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id ENqzNP26+mXbJQEAe85BDQ (envelope-from ) for ; Wed, 20 Mar 2024 11:31:25 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=pcGoxt4x; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710930685; 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=uhvEwEBI8fZLYwD2FI25HxSN9V6jywEBTs1esVc6tTk=; b=CBoD98BuKbSsUoIW/5litR+VUcObz6CsPoOnGzsPM9qQNYMILH5wDpFukLYgTGjapOHMHm aQTP/Qh6iT1q+DsrOUExqtxkx0QwdljBYnSUfn+0KAXuzPQsMypEtkF92xM5e2nfY/r7gq WDFg0ww0EUcjiQie7X2nZ8f93/znGk5eKtcUhHrFXuestc/LHlZBD0N3et/qlAa1kuwv71 GMpnDBXUAhQ5BDBXoHljktsadIGRoYSk4DzZK4B87z2aVtWUIrsFaATVXdgeMhXLLub1ur LHZ8KfpPg9dWykHYks9zwTCwbW4tKQsvU4Q/hp81mJ+BJZCVK33XtxpRTDWWSA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=pcGoxt4x; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710930685; a=rsa-sha256; cv=none; b=Z+jIbLlGe/b9HzaQmBUtSYK+hBvKvZAz3FOI1GttYuSfQlI7n+UZfRTN24hda5qqEaa+3e CcSuAqwNDdZcqKqj7rPy15vvtPuwKOw8NwkXW+lEe3pxBsOpAuc7dqahONZEsRoknCvi7c /EJV4OPPjk/lHbqfWM02pNiKD/GKWGvGQ3KMErMETEcUe8DWKPgk6Djn/GZdTgWXZRECV4 OyV1Z8GuhU70tibIJqSoMeVaM6cxBoJcHNw9FXSwH5SbRtAGHEpNZqDlcLc3UZ0gtKJ7RC oc4R5sSdIIfSYzTx/1isvGRi3ZGvnankv9+6QCfuf7xsGha2PhZJSfFy5sG9BA== 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 A65B522FB3 for ; Wed, 20 Mar 2024 11:31:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmtDq-0006H0-Pf; Wed, 20 Mar 2024 06:31:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmtDn-0006GY-Qy for emacs-orgmode@gnu.org; Wed, 20 Mar 2024 06:30:59 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmtDj-0003t4-Kd for emacs-orgmode@gnu.org; Wed, 20 Mar 2024 06:30:59 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A4459240027 for ; Wed, 20 Mar 2024 11:30:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1710930653; bh=Qlcwv7SVDd8HQ/FrZexMEccSREZY9BHn6l5n59uyFZA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=pcGoxt4xPibQ+PkldIrxiSzqucjpjLCigd528iNgyvEPBltzkZ9KUehlw/BUcgNN2 qXXHY40m7GBtJCt0pdRMYMkVn3rZzGv5mNQ+4Ewncc+W3r5msNWrsZM+HdfZp+HxJf FzWdExpI9J77J6ll28r2YorSl4sUgA3XxBgjvEkcNXrRhrj45bzu8d0M7sIdm/Zpi4 Eu9HjGXktIchvkHYQqRZltxhA5fxDZZL3Fq97ecdRfZKrFhR1QcbV8xYP1jlzZBByL 81tscuVTnAR+9JGq996KFrhwEe/zI0IPp7JaU+jJkt/bqgjWNwP5na8D0xshNST8R8 paZZtTR+vVA3Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V04cX6MF3z6twB; Wed, 20 Mar 2024 11:30:52 +0100 (CET) From: Ihor Radchenko To: Rick Lupton Cc: "Y. E." Subject: Re: [PATCH] Allow external libraries (org-roam) to supply org-id locations In-Reply-To: <253384f1-503f-4417-a060-74aac5b97090@app.fastmail.com> References: <715e7a79-2107-4c61-8b7c-26b68e680451@app.fastmail.com> <87zfv2wbyq.fsf@localhost> <87le6hyxf1.fsf@localhost> <253384f1-503f-4417-a060-74aac5b97090@app.fastmail.com> Date: Wed, 20 Mar 2024 10:30:48 +0000 Message-ID: <87jzlxjiuf.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.59 X-Spam-Score: -6.59 X-Migadu-Queue-Id: A65B522FB3 X-Migadu-Scanner: mx12.migadu.com X-TUID: m4K5ZnWzGUcx "Rick Lupton" writes: > The point is that I was thinking org-roam should advise/modify/hook the specific function `org-id-find' [to find ids in its database] but NOT the more general `(org-link-get-parameter "id" :follow)' [because `org-id-open' has a lot of extra logic for search-strings, backwards compatibility, where to open the new location, which it would not be reasonable to duplicate]. > > Is there a way to do this using the approach you are suggesting? No. Then, your patch makes sense. > +(ert-deftest test-org-link/org-id-find () > + "Test `org-id-find' specifications." > + (should > + (equal '("id.org" . 12) > + (org-test-with-temp-text "" > + (add-hook 'org-id-find-functions (lambda (id _markerp) (cons (concat id ".org") 12)) nil t) > + (org-id-find "id"))))) ... although this test does not look right. You are modifying the hook by side effect, retaining the value for all other tests. Please remove the hook after calling ~org-id-find~ via ~unwind-protect~. Also, before we merge your patch, may I know if you discussed this change with org-roam developers? If they do not want to use the proposed hook, there is no reason to add it to Org mode. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at