# How to force org-id links to open in other-window?

**URL:** <https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232>\
**Category:** Troubleshooting\
**Created:** [January 31, 2021, 3:49pm UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232 "2021-01-31T15:49:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![laotang](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@laotang](https://org-roam.discourse.group/u/laotang)\
**Post date:** [January 31, 2021, 3:49pm UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/1 "2021-01-31T15:49:13Z")

</div>

In relation to ideas regarding the use of org-id in [Org-roam major redesign](https://org-roam.discourse.group/t/org-roam-major-redesign/), I have a question that I seem unable to solve myself.

Usually, I work with a frame that has two windows. If I use `org-open-at-point ` on a link that starts with `LINK:file:...` the link is open in `other-window`, e.g. not the currently active one. This is the desired behaviour.

If, however, I use `org-open-at-point ` on a link that starts with `LINK:id:...` the link is open in `current-window`.

Is there a way to change this behaviour via `org-link-frame-setup`? Any help here would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![rakoenig](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/rakoenig/32/579_2.png) [@rakoenig](https://org-roam.discourse.group/u/rakoenig)\
**Post date:** [January 31, 2021, 6:48pm UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/2 "2021-01-31T18:48:47Z")

</div>

There is already an issue [#1340](https://github.com/org-roam/org-roam/issues/1340) about this problem on GitHub.

---

<div class="post-metadata">

**Author:** ![laotang](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@laotang](https://org-roam.discourse.group/u/laotang)\
**Post date:** [January 31, 2021, 7:17pm UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/3 "2021-01-31T19:17:46Z")

</div>

Then this is one of the rare cases my limited knowledge of all things Emacs was not the issue 😉

P.S. Your videos were very helpful in getting started with Emacs/Org-mode in the last year. Thanks a lot!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [February 1, 2021, 6:34am UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/4 "2021-02-01T06:34:16Z")

</div>

Are you talking about IDs in the note, not in the org-roam-buffer (in the side-buffer)?

If so, this looks like something the Org-roam project / Jethro can look at.  
Here is a result of my quick look. If it looks reasonable, you might like to report it to the project on GitHub to request a change.

Org-roam wraps the default `org-id-open` with its own `org-roam-id-open`.

`org-id-open` looks at `org-link-frame-setup`.

`org-roam-id-open` uses `org-goto-marker-or-bmk`, which calls `pop-to-buffer-same-window`. I do not see `org-link-frame-setup` used in this chain of functions.

---

<div class="post-metadata">

**Author:** ![laotang](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@laotang](https://org-roam.discourse.group/u/laotang)\
**Post date:** [February 1, 2021, 7:45am UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/5 "2021-02-01T07:45:29Z")

</div>

> [@nobiot](#):
>
> Are you talking about IDs in the note, not in the org-roam-buffer (in the side-buffer)?

Yes and I thought @rakoenig was referring to this. I added your info to the Github issue, thanks!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [February 1, 2021, 10:38am UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/6 "2021-02-01T10:38:54Z")

</div>

If code change needs to wait for side-buffer revamp (and/or V2), and you cannot wait, then it should be possible to implement your custom `open-id-at-point` (essentially, copy paste the parts from `org-id` version to replace `org-roam` one) and then replace the function set in the variable `org-open-at-point-functions`.

It should be set to `org-roam-open-id-at-point` when `org-roam` is activated – it should be globally applied even to files outside the `org-roam-directory` – this is how I understand all this works.

Alternatively, you could look to override `org-roam-id-open` with `advice-add` but that seems less clean way to me.

Sorry I cannot really do the code now, or do PR.

---

<div class="post-metadata">

**Author:** ![laotang](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@laotang](https://org-roam.discourse.group/u/laotang)\
**Post date:** [February 1, 2021, 5:19pm UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/7 "2021-02-01T17:19:11Z")

</div>

I was thinking about using [the approach outlined](https://github.com/org-roam/org-roam/issues/1340#issuecomment-756750202) on the Github page, e.g. turning this line into a comment:

`(add-hook 'org-open-at-point-functions #'org-roam-open-id-at-point)`

Could this cause any long-term issues I am not aware of?

> [@nobiot](#):
>
> Sorry I cannot really do the code now, or do PR.

This already really helpful and appreciated!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [February 1, 2021, 9:00pm UTC](https://org-roam.discourse.group/t/how-to-force-org-id-links-to-open-in-other-window/1232/8 "2021-02-01T21:00:19Z")

</div>

I cannot be too sure; very different system usage, so I cannot really judge. I prefer to rely on the Org-roam’s cache DB for ID store to `org-id`’s method. I even keep `org-id-link-to-org-use-id` default `nil`.

But I don’t imagine there would be too much of an issue – or even if there were to be an issue, it could be rectified rather easily.

> natask  
> This doesn’t use org roams database for ids but I haven’t had issues because all my files are found within org-id’s internal database

As natask says in the GitHub issue, you would need to use Org-id mechanism (you have turned on the variable, so that would be done, I think) to store ID links so that they work properly – I think Org-roam would store ID in its cache db in parallel anyway, even if you don’t use this to open ID links (what you are disabling is open function, not store function).
