Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function orb-open-associated-note #238

Merged
merged 2 commits into from
Jan 13, 2022
Merged

New function orb-open-associated-note #238

merged 2 commits into from
Jan 13, 2022

Conversation

premopie
Copy link
Contributor

New function orb-open-associated-note according with #191 (comment)

premopie and others added 2 commits January 13, 2022 17:16
- also make the function interactive and complain if not in Org-mode
@myshevchuk
Copy link
Member

I rephrased the docstring and messages to conform with Emacs standards (fill-column, double space, no trailing punctuation in errors) and made the function interactive. Otherwise it works perfectly. Thank you!

@myshevchuk myshevchuk merged commit 1a2b311 into org-roam:master Jan 13, 2022
@samspo
Copy link

samspo commented Jan 14, 2022

orb-edit-citation-note doesn't work for me.
It says 'cursor not in a org-cite element'.
In my org-roam-bibtex config, I have: (setq orb-roam-ref-format 'org-cite)

@myshevchuk
Copy link
Member

myshevchuk commented Jan 14, 2022

@SampSo

orb-edit-citation-note should be called when the point is on an Org-cite [cite:@citekey] citation. However, it will not work if the citation is within a property drawer, e.g. in ROAM_REFS - that's a limitation imposed by Org syntax. It will work anywhere else in the buffer.

In my org-roam-bibtex config, I have: (setq orb-roam-ref-format 'org-cite)

That plays no role for this function. It is for Org-cite citation anywhere in Org documents, except of property drawers as per above.

@samspo
Copy link

samspo commented Jan 14, 2022

Thanks for the follow-up.
Of course I'm on an org-cite citation. I'm not in a property drawer either.
I have no idea why it doesn't work. Might be a problem in my config.

@premopie
Copy link
Contributor Author

@samspo try to move cursor on the Org mode citation and eval there (using M-:) the org-element-context function. Confirm that you can see (in messages) a list starting with citation or citation-reference. You should see this if you have Org 9.5 org newer.

@myshevchuk
Copy link
Member

myshevchuk commented Jan 14, 2022

@samspo I went too far in my assumptions. You mentioned orb-roam-ref-format which is only responsible for setting the citation as a ROAM_REFS key in the properties drawer. So I related that to orb-edit-citation-note not recognizing Org-cite citations.

Must indeed be something with your setup. Try `M-x load-library org-cite'.

@samspo
Copy link

samspo commented Jan 14, 2022

Thanks @premopie and @myshevchuk
Yes. My org-version is Version: 9.5.2 but there is a problem with org-element-context in my config. I must investigate that.
Side note: @myshevchuk I understand now that orb-roam-ref-format is only responsible for setting the citation as a ROAM_REFS key in the properties drawer. From a user perspective, it would make sense that this variable also allows to customize the format of the links recognized by orb-edit-citation-note

@myshevchuk
Copy link
Member

myshevchuk commented Jan 14, 2022

From a user perspective, it would make sense that this variable also allows to customize the format of the links recognized by orb-edit-citation-note

I must disagree. orb-roam-ref-format has nothing to do with orb-edit-citation-note. It's easy to run out of good names for Elisp symbols and I don't particularly like the 'format' part, but the orb-roam-ref part is what it is - a style/format of ROAM_REFs inserted by ORB.

orb-edit-citation-note does not require any control variables - it should work with/on citations, more specifically it should process a citation, retrieve the key and launch ORB's edit note functionality. Currently it only works with Org-cite citations, but it should definitely be expanded to work Org-ref citations too. There is simply no need for a control variable: if a user runs this command when not on a citation, then do nothing. If the point is on a citation element then do what the function's name implies.

@samspo
Copy link

samspo commented Jan 15, 2022

Ok. Thanks for the follow-up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants