# Org-Roam from opening all nodes on startup, bypassing org-mode hooks

**URL:** <https://org-roam.discourse.group/t/org-roam-from-opening-all-nodes-on-startup-bypassing-org-mode-hooks/2572>\
**Category:** Troubleshooting\
**Created:** [April 20, 2022, 2:09am UTC](https://org-roam.discourse.group/t/org-roam-from-opening-all-nodes-on-startup-bypassing-org-mode-hooks/2572 "2022-04-20T02:09:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandelbot](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mandelbot](https://org-roam.discourse.group/u/mandelbot)\
**Post date:** [April 20, 2022, 2:09am UTC](https://org-roam.discourse.group/t/org-roam-from-opening-all-nodes-on-startup-bypassing-org-mode-hooks/2572/1 "2022-04-20T02:09:18Z")

</div>

I am having a similar issue to the one posted by another user here:

> **[r/OrgRoam - How to prevent or mitigate org roam opening notes on startup](https://www.reddit.com/r/OrgRoam/comments/qoohy7/how_to_prevent_or_mitigate_org_roam_opening_notes/)**
>
> 2 votes and 0 comments so far on Reddit

Org-Roam opens all of my nodes in buffers on startup, which on it’s own is a minor quirk. The issue is that several minor modes that I have hooked to Org-Mode (org-superstar-mode, mixed pitch mode, org-bars-mode) do not load and I have to restart-org-mode in each buffer to get the minor modes to load.

The aforementioned minor modes load fine when I open org documents outside of my org-roam-directory.

Is Org-Roam supposed to be opening all of my nodes on startup? Is there a way I can prevent this behaviour? or should I hook the above minor modes to something else to ensure that they load properly in my nodes on startup?

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:** [April 20, 2022, 5:33am UTC](https://org-roam.discourse.group/t/org-roam-from-opening-all-nodes-on-startup-bypassing-org-mode-hooks/2572/2 "2022-04-20T05:33:40Z")

</div>

> [@mandelbot](#):
>
> Is Org-Roam supposed to be opening all of my nodes on startup?

No, it is not. Mine does not do it, and this is probably the first report of this issue in this forum.  
For this issue, my suggestions are:

1. Try without using `emacsclient`
2. Try with no config other than Org-roam

> [@mandelbot](#):
>
> should I hook the above minor modes to something else to ensure that they load properly in my nodes on startup

For this issue, I suspect it might be your loading sequence.

I suggest you review your configuration and see if you set up your hooks for minor modes after `org-roam-autosync-mode` (or whatever causing notes buffers to open – org-roam is not supposed to keep them open); if so, move `org-roam-autosync-mode` after all the hooks set up for the minor modes.

---

<div class="post-metadata">

**Author:** ![mandelbot](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mandelbot](https://org-roam.discourse.group/u/mandelbot)\
**Post date:** [April 20, 2022, 3:52pm UTC](https://org-roam.discourse.group/t/org-roam-from-opening-all-nodes-on-startup-bypassing-org-mode-hooks/2572/3 "2022-04-20T15:52:43Z")

</div>

Thanks nobiot, you are correct this was not an Org-Roam issue, but rather Org-Agenda is opening all my nodes because I have my agenda files set to my org-roam directory. I think this is normal behavior for that package once triggered (it opens at startup because I am using the emacs dashboard package).

The only issue I am seeing now is that the hooks do not trigger in consult previews (via vertico completion module in doom) or when opening nodes via `consult-org-agenda`.

At any rate this is not an Org-Roam issue, though I am still unsure why vertico preview and completion wont trigger the hooks.

---

<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:** [April 20, 2022, 6:12pm UTC](https://org-roam.discourse.group/t/org-roam-from-opening-all-nodes-on-startup-bypassing-org-mode-hooks/2572/4 "2022-04-20T18:12:37Z")

</div>

> [@mandelbot](#):
>
> At any rate this is not an Org-Roam issue, though I am still unsure why vertico preview and completion wont trigger the hooks.

If you get Org Agenda to open notes in `org-roam-directory` in your `init`, it’s still possible that this is done before your `hooks` are set in `init` – the same point as my second one above (loading sequence).

If you’re certain that Org Agenda opens these buffers after hooks are set, then I’m not sure what’s happening – it does not sound like `consult` is relevant if Org Agenda opens the buffers.

---

<div class="post-metadata">

**Author:** ![mandelbot](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mandelbot](https://org-roam.discourse.group/u/mandelbot)\
**Post date:** [May 17, 2022, 6:28pm UTC](https://org-roam.discourse.group/t/org-roam-from-opening-all-nodes-on-startup-bypassing-org-mode-hooks/2572/5 "2022-05-17T18:28:31Z")

</div>

For posterity I just wanted to say that this is definitely not an org-roam issue (at least not as I was experiencing it) and I was able to fix this for org-agenda by changing the loading sequence.

Regarding consult, I think I was confused by the fact that consult preview loads limited hooks to maintain the speed of preview? [It’s possible to add hooks](https://github.com/minad/consult/issues/535) but this seriously degraded the speed of previews for me.
