From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id oNJjM2zD9mXVcwEAe85BDQ:P1 (envelope-from ) for ; Sun, 17 Mar 2024 11:18:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oNJjM2zD9mXVcwEAe85BDQ (envelope-from ) for ; Sun, 17 Mar 2024 11:18:20 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=S3PoXTPp; 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=1710670700; a=rsa-sha256; cv=none; b=J/mtTUcDcjIjOFUmMWnjMf3rts5kELccjhUxgBsc0PZX+VvJ3sFEfjaGLTjVXI2oiR5KZO zoslzJbz2l4/YXJq3PRJ0KjrGPQ30mzbCHrI8Gcl+a4W/H2zEc2PRLSBYmZR60oX0tQBYt zjQLExuJXeo+hy4cYVBDcVPaq8eSTqHPTciwXFLraQn8GYaWxrB12oeIlmzV5b8t+6oR1q d7BI2OPezIlLTWU4pp4AElgt63RK5x4yyhkEOh67DBsV/dEzZH//NcvGCkkKjFpO5whyCl 48WJHjXfLKpkqfTW5E5GfA/+HEBPjVsyf6mmVC+2jo+cFeB9m9EQQioD20DkRg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=S3PoXTPp; 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=1710670700; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=vuGYbw+Tuu8Tj1WeMO3Qufu+c3K86BHi6SqspjEMfpE=; b=Yf80eKjF4a4j3YHVvmsDPFmhGHPk1+A9enb5lbGFrAkf/iRPIpJ+lf/Q1TO6jY5Fkir7hg rNMQSNYUii1R63jbcnxi8uJ3M7Ep845SNnuwoSfOYPTm89CdElVAxmzaYlB0Fmfu4Q1IBd M9puFsW38wByxIom7M+DOGtbVBunG9/E/vPWmcXZ8/mqbtTeG1ReIernnQRCx2ZnQvvX7W CV2wlQQyfEDLJ/eX7+Wqq1r+sNJSs6R1zebEW5ZKvtt/p22SWNnK36BigqyA4nQ2+yqcoy 4069QeO416ZUlAXmNdIJkLaHb+pP5SKFScnw88pLT16nzmfkHHd5INXi67st7A== 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 8165A76249 for ; Sun, 17 Mar 2024 11:18:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlnag-0005hN-H9; Sun, 17 Mar 2024 06:18:06 -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 1rlnad-0005hF-IJ for emacs-orgmode@gnu.org; Sun, 17 Mar 2024 06:18:03 -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 1rlnab-0005if-PQ for emacs-orgmode@gnu.org; Sun, 17 Mar 2024 06:18:03 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id CF66C24002A for ; Sun, 17 Mar 2024 11:17:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1710670678; bh=0bvyjOmXi3JEmssBBFWcqxTPJGsUPMOA2fD1+CmsFOs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=S3PoXTPpGmRRoaMzGXXOCREh2ZxEet8gEtWBCrcefeIeswcyp70kuwo8sIjxmKvNf wTH2EHg5hMTYvJRR7ObVT3g5qiNumegYI/TzSUEwhbkp8NQgwxj7wiEj1hhsYvyDrE 53gpgNeTKB5HE8p5NxOdQIJ7eLBxu8p4ahaSp0Tggb9AwZ6Z9pdDayfs+k83P31INi hbhwaVr6WHLLpZsmebFav4ZFHVUvteF4pXzSCPP+ej/0n4vJZVVjGniH0ai9Z7RO+Y lb3+HPWSEkg2af8yX3Z8nyjaAulTsqldb90A5kNrTAKaDU6p1V+OktTnnxlz9zcHRP JjkvQYlwzefFQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TyDT16BJhz6tm4; Sun, 17 Mar 2024 11:17:57 +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: References: <715e7a79-2107-4c61-8b7c-26b68e680451@app.fastmail.com> <87zfv2wbyq.fsf@localhost> Date: Sun, 17 Mar 2024 10:17:54 +0000 Message-ID: <87le6hyxf1.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.49 X-Spam-Score: -9.49 X-Migadu-Queue-Id: 8165A76249 X-TUID: 3wRWERU6m30E "Rick Lupton" writes: > On Wed, 13 Mar 2024, at 12:30 PM, Ihor Radchenko wrote: >> I think that we can do it simpler. [...] >> The idea is to use Emacs' advice machinery to allow third-party code >> alter the functions stored in link parameters. > > I was avoiding this because I thought it was only recommended (in the eli= sp manual) to use advice directly by users, not in libraries (like, I assum= e, org-roam): > >> If you are writing code for release, for others to use, try to avoid inc= luding advice in it. If the function you want to advise has no hook to do t= he job, please talk with the Emacs developers about adding a suitable hook.= Especially, Emacs=E2=80=99s own source files should not put advice on func= tions in Emacs. (There are currently a few exceptions to this convention, b= ut we aim to correct them.) It is generally cleaner to create a new hook in= foo, and make bar use the hook, than to have bar put advice in foo. > > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Named= -Functions.html) This is absolutely right, but only when advising named functions. What we are talking about is advising the link property value. In my previous discussions with Emacs devs, I was told that it superior to use advice system when a library wants to modify a function stored as a value of a variable - see https://yhetil.org/emacs-devel/SJ0PR10MB548885B715C9875726F70F61F34FA@SJ0PR= 10MB5488.namprd10.prod.outlook.com/ > But I don't mind either way. I agree your approach is simpler if it's a = reasonable way for a third party library like org-roam to extend the org id= functions. I added the setter on main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3Dd545ad606 We may also want to document the `add-function' approach in the manual. Maybe in a new section "Modifying Hyperlink Types", right after "Adding Hyperlink Types". --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at