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

(feat): remove IDs created during capture #1155

Merged
merged 2 commits into from Sep 30, 2020
Merged

(feat): remove IDs created during capture #1155

merged 2 commits into from Sep 30, 2020

Conversation

jethrokuan
Copy link
Member

@jethrokuan jethrokuan commented Sep 30, 2020

Previously we had overwritten the Org's store link function for files,
to create IDs if the point was under the headline. This has several
issues:

  1. It becomes impossible to store a link to the file using org-store-link
  2. This override is global across Org, although we had a guard in
    org-roam-store-link
  3. IDs are created during an org-capture, because org-capture calls org-store-link

This is unnecessary. Org provides org-id-store-link instead for this
purpose. Instead, we advice org-id-new, to queue the file for a DB
update if an ID was created.

Also, setting org-id-link-to-org-use-id to t restores this behaviour.

Previously we had overwritten the Org's store link function for files,
to create IDs if the point was under the headline. This has several
issues:

1. It becomes impossible to store a link to the file using `org-store-link`
2. This override is global across Org, although we had a guard in
`org-roam-store-link`
3. IDs are created during an org-capture, because org-capture calls `org-store-link`

This is unnecessary. Org provides `org-id-store-link` instead for this
purpose. Instead, we advice `org-id-new`, to queue the file for a DB
update if an ID was created.
@rtrppl
Copy link

rtrppl commented Nov 5, 2020

Sorry to open this again but if I use IDs the backlinks to headings do not show up (it works fine without using ord-id). I've added this to my .emacs:

(setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)

Edit: Ok, that is weird: if, in addition to the links to certain headings, I use org-roam-insert to link to the file, all links with IDs also show up in the backlinks.
Edit II: It has to do with the update-process of the DB, which you @jethrokuan probably were referring to with org-id-new but which I'm too much of a beginner in all things emacs/org-roam to understand.

Edit III: I was the culprit, sorry for the confusion. I missed the crucial step of "saving" the files with the ID.

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.

None yet

2 participants