0

I like to have the Help buffer in a some frame (with some other windows) and I try to reuse this window in this frame even when I am in another frame and issue a help command.

I tried setting

(setq display-buffer-alist
      '(("\\*Help\\*" display-buffer-reuse-window)))

but this seem to reuse the window only when it is in the same frame.

How can I tell the display-buffer system to reuse a window in any (visisble) frame?

Y. E.
  • 668
  • 4
  • 8
halloleo
  • 1,215
  • 9
  • 23

1 Answers1

0

This is covered in the documentation for the function you're using.

Refer to all of the details regarding frames:

display-buffer-reuse-window is a byte-compiled Lisp function in
`window.el'.

(display-buffer-reuse-window BUFFER ALIST)

Return a window that is already displaying BUFFER.
Preferably use a window on the selected frame if such a window
exists.  Return nil if no usable window is found.

ALIST is an association list of action symbols and values.  See
Info node `(elisp) Buffer Display Action Alists' for details of
such alists.

If ALIST has a non-nil `inhibit-same-window' entry, the selected
window is not eligible for reuse.

If ALIST contains a `reusable-frames' entry, its value determines
which frames to search for a reusable window:
  nil -- the selected frame (actually the last non-minibuffer frame)
  A frame   -- just that frame
  `visible' -- all visible frames
  0   -- all frames on the current terminal
  t   -- all frames.

If ALIST contains no `reusable-frames' entry, search just the
selected frame if `display-buffer-reuse-frames' and
`pop-up-frames' are both nil; search all frames on the current
terminal if either of those variables is non-nil.

If ALIST has a non-nil `inhibit-switch-frame' entry, then in the
event that a window on another frame is chosen, avoid raising
that frame.

This is an action function for buffer display, see Info
node `(elisp) Buffer Display Action Functions'.  It should be
called only by `display-buffer' or a function directly or
indirectly called by the latter.
phils
  • 48,657
  • 3
  • 76
  • 115
  • Interesting! I didn't know, that `display-buffer-reuse-window` is a normal function. But how can I give it as a property in `display-buffer-alist` the additional parameter so that it finds the window in other frames as well? – halloleo Apr 13 '23 at 13:09
  • Follow the documented manual links, and see the adjacent node `(elisp)The Zen of Buffer Display` for many examples. – phils Apr 13 '23 at 13:19