Add customisable function for prompting when adding refs#2317
Merged
jethrokuan merged 2 commits intoorg-roam:mainfrom Feb 23, 2023
Merged
Add customisable function for prompting when adding refs#2317jethrokuan merged 2 commits intoorg-roam:mainfrom
jethrokuan merged 2 commits intoorg-roam:mainfrom
Conversation
Function for prompting when adding a ref.
Prompt properly for ref.
53b529e to
c1b3d19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
I only use bibliography keys as refs, but I use a lot (e.g. for a book I'm half way through, I have nine nodes with the book's ref). When I want to add the ref to a node, at the moment I have to get the book's ref key somehow (e.g. with an embark action from citar, or by copying straight from Ebib), then run ``org-roam-ref-add`, then type '@', and finally insert the ref key and hit RET. This is a heavy workflow for something I do so often.
I imagine other users feel similarly. This PR lets the user set a prompt function for getting refs, which can streamline processes like this.
Personally, I could set this to a simple wrapper over
citar-select-ref, though others might do otherwise. This makes the whole process of adding refs much simpler. Leaving the variable at nil retains the current behaviour or just prompting for a string.