Skip to content

(feat) core: support new org-mode citations#1806

Merged
jethrokuan merged 4 commits intomasterfrom
cite
Aug 29, 2021
Merged

(feat) core: support new org-mode citations#1806
jethrokuan merged 4 commits intomasterfrom
cite

Conversation

@jethrokuan
Copy link
Member

@jethrokuan jethrokuan commented Aug 25, 2021

Motivation for this change

Support caching the new Org 9.5 citations.

Because citations now has first-class support, and are treated
differently from links, they are now cached in their own table.

Org-ref citations, instead of being stored in the links table, are now
stored in the citations table instead.

To use a citation as a ROAM_REF, use the @citeKey syntax.

@jethrokuan jethrokuan force-pushed the cite branch 2 times, most recently from 1b6a6fc to fc5ce67 Compare August 27, 2021 12:11
Support caching the new Org 9.5 citations.

Because citations now has first-class support, and are treated
differently from links, they are now cached in their own table.

Org-ref citations, instead of being stored in the links table, are now
stored in the citations table instead.

To use a citation as a ROAM_REF, use the `@citeKey` syntax.
@jethrokuan jethrokuan requested a review from Wetlize August 28, 2021 11:06
@jethrokuan jethrokuan changed the title WIP: support new org-mode citations (feat) core: support new org-mode citations Aug 28, 2021
Copy link
Contributor

@Wetlize Wetlize left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid that I'm not going to be a large help here, since citations are simply not present in my current workflow (though I might incorporate them later) and I'm completely unfamiliar with org-cite (except a very brief familiarization), and not so much with org-ref, which I've stopped using a while ago. In any case, I'll still try to help you.

However, I would try to invite @bdarcus to review this. AFAIK he was actively participating through the design process of org-cite and also maintains bibtex/citation related packages, while also at the same time uses(?) org-roam. It also probably would make sense to invite @myshevchuk and @ThomasFKJorna, since both of them maintain packages that interface with citations.

Other than that, I've briefly tested this PR all over the place and it works just fine. So it LGTM.
Edit: It looks like org-roam-graph is completely unaware about the new citation table, so it won't render them. Though it can be something that can be done later, post merge.

,* Probabilistic Robotics
:PROPERTIES:
:ID: 51b7b82c-bbb4-4822-875a-ed548cffda10
:ROAM_REFS: @thrun2005probabilistic
Copy link
Contributor

@Wetlize Wetlize Aug 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really have anything meaningful to add on this, but AFAIU this is not something that would be actionable/interactable? Since this is a custom format. IIRC org-ref's "cite:" were actionable, just like URL links. I'm not sure whether this even important (probably not), but just wanted to highlight this, so someone else who's more knowledgeable on citations would evaluate this.

Copy link
Contributor

@bdarcus bdarcus Aug 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I raised this question on the org-mode list recently, though have not yet had any responses.

https://lists.gnu.org/archive/html/emacs-orgmode/2021-08/msg00317.html

If anyone has opinions on this, it might be good to reply to that post.

My tentative suggestion there was to allow citations in the property drawers, but I am still not sure.

As @Wetlize notes, references of this form won't be treated as citations by org, and so they don't be actionable.

Thoughts?

Edit: I suppose it's easy enough to start with this, and if org is changed to allow citations there, reconsider?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to update, org-cite dev says it's a "terrible idea" to allow cites in property drawers :-)

https://lists.gnu.org/archive/html/emacs-orgmode/2021-09/msg00130.html


;;; Variables
(defconst org-roam-db-version 16)
(defconst org-roam-db-version 17)
Copy link
Contributor

@Wetlize Wetlize Aug 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly unrelated to this PR, but I immediately noticed that building the database from scratch through automatic upgrade feels orders of magnitude more slower than building the database from scratch manually (i.e. through the force sync). Not sure what's going on there, but it's something reproducible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly unrelated to this PR, but I immediately noticed that building the database from scratch through automatic upgrade feels orders of magnitude more slower than building the database from scratch manually (i.e. through the force sync). Not sure what's going on there, but it's something reproducible.

Worth looking into separately, I guess.

This removes any additional setup from user
@jethrokuan jethrokuan merged commit 340215a into master Aug 29, 2021
@jethrokuan jethrokuan deleted the cite branch August 29, 2021 11:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants