[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Allow external libraries (org-roam) to supply org-id locations
From: |
Rick Lupton |
Subject: |
[PATCH] Allow external libraries (org-roam) to supply org-id locations |
Date: |
Tue, 12 Mar 2024 23:18:55 +0000 |
User-agent: |
Cyrus-JMAP/3.11.0-alpha0-251-g8332da0bf6-fm-20240305.001-g8332da0b |
Hi all,
Since updating the org-id code [1] to use the standard org-link registered
functions instead of hard-coding org-id opening, I have a problem using
org-roam.
org-roam overwrites the :follow function for "id" links from the build-in
`org-id-open' to its own `org-roam-id-open'
(https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-id.el#L91).
The only change between these functions is to insert a call to try
`org-roam-id-find' before trying `org-id-find', which uses org-roam's cached
sqlite database to find the id
(https://github.com/org-roam/org-roam/blob/8667e441876cd2583fbf7282a65796ea149f0e5f/org-roam-id.el#L70-L71)
As well as being messy, my specific problem is that the improvements to open
search strings in org-id links are no longer enabled when org-roam is loaded.
It seems reasonable that a library might want to provide its own way of
locating org-ids. The attached patch adds a new hook variable
`org-id-find-functions` which contains functions doing the same job as
`org-id-find' that should be tried first. Then all org-roam needs to do is add
its `org-roam-id-find' to the hook.
Does this seem like a good idea?
Thanks,
Rick
[1] Link:
https://list.orgmode.org/118435e8-0b20-46fd-af6a-88de8e19fac6@app.fastmail.com/
0001-lisp-org-id.el-add-hook-org-id-find-functions.patch
Description: Binary data
- [PATCH] Allow external libraries (org-roam) to supply org-id locations,
Rick Lupton <=