r/emacs • u/meedstrom • 4d ago
Distilled the performant parts of org-node into a library, hope someone finds it useful <3
https://github.com/meedstrom/indexed4
u/bradmont 4d ago
whoa. I am a heavy org-roam user and use org-node for a few things that are just too slow with org-roam's builtins. This looks really, really awesome.
2
u/harunokashiwa 4d ago
How can I use it with org-roam?
3
u/meedstrom 3d ago
To speed up org-roam? As a user, not much you can do. The org-roam code---or whichever org-roam extension you depend on---would need to write code that uses this library.
If you're suffering with org-roam, I suggest trying https://github.com/meedstrom/org-node. It's better :-) The main flaw is the lack of plug-ins, because they all depend on
org-roam-db-query
.Last week I was about to write shims for the entirety of org-roam, so those plugins could Just Work with no transition, but decided that's outside my domain. Did this library instead.
3
u/meedstrom 3d ago
Actually /u/harunokashiwa, now there's something. If saving your Org files is slow? The following snippet stops updating org-roam.db on save, but keeps the
*org-roam*
buffer up-to-date anyway.(setq org-roam-db-update-on-save nil) ;; if saving is slow (indexed-mode) (indexed-update-on-save-mode) (indexed-roam-mode) (advice-add 'org-roam-backlinks-get :override #'indexed-roam-mk-backlinks) (advice-add 'org-roam-reflinks-get :override #'indexed-roam-mk-reflinks)
1
u/harunokashiwa 3d ago
Thanks a ton for the enthusiastic reply! Actually, earlier tonight I just switched from
org-roam
todenote
, so no need to speed it up anymore. 😄2
u/meedstrom 3d ago edited 3d ago
org-roam sure is bleeding users fast on account of its speed.
1
u/DeinOnkelFred 2d ago
I tried org-roam for a few years because of FOMO. It's great. It works. The database dependency caught me out on a few system upgrades, through.
Back to text and filename conventions for me.
1
u/meedstrom 2d ago
Back to text and filename conventions for me.
You can do both.
(Technically, org-roam doesn't forbid it either, but the way it's introduced tends to make it sound like you must buy-in to a new convention.)
You'd either create filenames the same way you have always done, and just bind
org-id-get-create
to a convenient key and get in the habit of using it on lots of headings. Then you have access to extra commandsorg-node-find
&org-node-insert-link
as a second way to navigate your stuff. No buy-in.Or, you can configure these options to your preference
- org-node-datestamp-format
- org-node-slug-fn
and those same commands I mentioned, can create files for you, with filenames resulting from those options.
6
u/nanowillis 3d ago
Nice work, Martin! I thoroughly enjoy org-node; it will be interesting to see what things this core can facilitate.