# \*org-roam\* buffer in frame A not refreshing for org buffers in frame B

**URL:** <https://org-roam.discourse.group/t/org-roam-buffer-in-frame-a-not-refreshing-for-org-buffers-in-frame-b/3575>\
**Category:** Troubleshooting\
**Created:** [September 6, 2024, 4:07pm UTC](https://org-roam.discourse.group/t/org-roam-buffer-in-frame-a-not-refreshing-for-org-buffers-in-frame-b/3575 "2024-09-06T16:07:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mricke](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/mricke/32/754_2.png) [@mricke](https://org-roam.discourse.group/u/mricke)\
**Post date:** [September 6, 2024, 4:07pm UTC](https://org-roam.discourse.group/t/org-roam-buffer-in-frame-a-not-refreshing-for-org-buffers-in-frame-b/3575/1 "2024-09-06T16:07:14Z")

</div>

My elisp isn’t the best, so I would appreciate if someone could tell me what I’m doing wrong.

```auto
(defun buffer-exists (bufname doathing)
  "Helper function to do something if bufname
exists and current buffer is org file."
  (when (and (string-match "^.*\.org$"
(buffer-name)) (not (eq nil (get-buffer
bufname))))
      (funcall doathing)))

(defun org-roam-backlinks ()
  "Redisplays buffer as long as current buffer
is not *org-roam* and *org-roam* buffer exists"
  (buffer-exists "*org-roam*"
'org-roam-buffer--redisplay-h))

(add-hook 'post-command-hook 'org-roam-backlinks)

```

---

<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:** [September 7, 2024, 3:37pm UTC](https://org-roam.discourse.group/t/org-roam-buffer-in-frame-a-not-refreshing-for-org-buffers-in-frame-b/3575/2 "2024-09-07T15:37:36Z")

</div>

Just to be sure…: the [manual](https://www.orgroam.com/manual.html#The-Org_002droam-Buffer) has this.

> `org-roam-buffer-toggle`: Launch an Org-roam buffer that tracks the node currently at point. This means that the content of the buffer changes as the point is moved, if necessary.

This does not work across frames?

---

<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:** [September 7, 2024, 7:07pm UTC](https://org-roam.discourse.group/t/org-roam-buffer-in-frame-a-not-refreshing-for-org-buffers-in-frame-b/3575/3 "2024-09-07T19:07:44Z")

</div>

Just overriding `org-roam-buffer--redisplay-h` seems to do the job

```auto
(defun org-roam-buffer--redisplay-h ()
  "Reconstruct the persistent `org-roam-buffer'.
This needs to be quick or infrequent, because this designed to
run at `post-command-hook'."
  (and (get-buffer-window org-roam-buffer :all-frames) ;;<- just added an additional argument to `get-buffer-window'
       (org-roam-buffer-persistent-redisplay)))

```

---

<div class="post-metadata">

**Author:** ![mricke](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/mricke/32/754_2.png) [@mricke](https://org-roam.discourse.group/u/mricke)\
**Post date:** [September 7, 2024, 7:56pm UTC](https://org-roam.discourse.group/t/org-roam-buffer-in-frame-a-not-refreshing-for-org-buffers-in-frame-b/3575/4 "2024-09-07T19:56:38Z")

</div>

Unfortunately, no. org-roam-buffer-toggle does display \*org-roam\* and will refresh backlinks for a given node visited in a buffer in the same frame. Unless \*org-roam\* is present in both frames, it won’t work across frames, which seems kindof redundant. Really, I would just like the option to open a frame with a sole window just for backlinks. If I replace the above code with (org-roam-db-autosync-mode) it behaves the same way. Is this just expected behaviour for org-roam?

Edit: sorry, I didn’t see your reply. I’ll try that out.

---

<div class="post-metadata">

**Author:** ![mricke](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/mricke/32/754_2.png) [@mricke](https://org-roam.discourse.group/u/mricke)\
**Post date:** [September 7, 2024, 8:08pm UTC](https://org-roam.discourse.group/t/org-roam-buffer-in-frame-a-not-refreshing-for-org-buffers-in-frame-b/3575/5 "2024-09-07T20:08:54Z")

</div>

> [@nobiot](#):
>
> ```auto
> (defun org-roam-buffer--redisplay-h ()
> "Reconstruct the persistent `org-roam-buffer'.
> This needs to be quick or infrequent, because this designed to
> run at `post-command-hook'."
> (and (get-buffer-window org-roam-buffer :all-frames) ;;<- just added an additional argument to `get-buffer-window'
> (org-roam-buffer-persistent-redisplay)))
> 
> ```

It works and it’s so simple! Thank you so much.
