Adding Hydra Menu for Org Roam Lookup in Emacs

Pre-Populating 'org-roam-find-file' to Help Topic Lookup

For the , I’ve been using org-roam to help organize my notes. org-roam builds on top of org mode, providing a vast array of text and information management tooling.

, I reached out to my brother, son, and two long-time friends to see about running a campaign; This would be in addition to my campaign.

I said I’m interested in running either Stars without Number: Revised Edition 🔍 or Worlds without Number 🔍. Right now we’re leaning towards WWN. I backed the Kickstarter for “Worlds without Number” which gave me access to the ongoing Beta documents.

As I started taking notes on my campaign, I ran into a bit of an organizational snag; My current note-taking tooling works well with one fictional setting and campaign. Adding a second fictional setting and campaign will make disambiguation more difficult.

Organizing Information

I started thinking about what I needed.

First and foremost, I needed a way to quickly scope my searches. With minimal key strokes I wanted to narrow my search to “thel-sector” or the new campaign. Or “samvera” or “bibliography” or what not.

Second, I wanted the above search behavior to apply to Org Roam’s quick search and insert link function org-roam-insert. When I invoke org-roam-insert, it brings up a prompt to search all notes. As I type, the list narrows. If I select a result from the search, the function creates a link in the file from which I started the search. If I don’t select a result, the function opens an buffer to create a new note. When I close the buffer, the function creates a link to the newly created file.

Organization Thus Far

With an hour of learning and work, here’s what I settled on using the pretty-hydra.el package.

(use-package pretty-hydra
  :straight (pretty-hydra
             :type git :host github
             :repo "jerrypnz/major-mode-hydra.el"
             :files (
               :defaults (
                 :exclude "major-mode-hydra.el"))))
Table 214: Textual Representation of my Find File in Roam Project
GroupKeyLabel
OrgoOrg Agenda
OrgiOrg Roam Index
PermanentbBibliography
PermanentcCard
RPGsaArdu, World of
RPGstThel Sector
WorktHesburgh Libraries
WorksSamvera

Here’s the the configuration for my Org Roam Hydra.

I invoke the menu via Cmd+1, then pick an option. For the “Org” groups, these commands open associated files. For the “RPGs”, “Work”, and “Permanent” it invokes the org-roam-find-file and pre-populates the search result with the corresponding text.

This means when I want to look-up something I can open the “Find File in Roam Project” menu. However, this does not help in searching for a note and linking to the originating note.

What I Still Want

I would like the org-roam-insert to pre-populate a search result in a similar manner as what I’ve worked out the “Find File in Roam Project” menu.

I haven’t yet explored that functionality, and will be asking for some help from the Emacs (Emacs 🔍) community.

This second need is most useful when I’m taking notes while playing in a game.

While running a game, I have a primary document (e.g. the “session”) where I record notes. During the session, as we introduce topics or subjects, I either link to an existing note or create a new note and link to that note.

Having a quick means of narrowing both search and subject creation will help in my game facilitation and note taking.

I’ve got some ideas, but for now, I’m focusing on writing up my notes from Thel Sector game and preparing for a possible Session 0 for a Worlds without Number game.