When using an emacs command that uses display-buffer (e.g. following an error from compile-mode, calling list-buffers, etc.), if the buffer is open in another frame, it doesn't open in a window in the current frame, even if the frame is not on the current desktop (for context, I tend to use two emacs frames at a time, one visible on all desktops, and one only on a single destop).

I see in the documentation for display-buffer that it takes an optional argument FRAME, and it seems like the value visible would do what I want, but since I'm not calling display-buffer directly, I'm not sure how to set this argument. Any ideas?

  • Not really an answer, because my attempts at doing so got nowhere, but in general I think you'd want to advise (display-buffer) and change its arguments such that the only frame specifier was the value of (current-frame); changing the FRAME argument I think isn't enough to have the desired effect, though, because the ACTION argument takes a list whose members' cdrs are alists in which can be specified a list of frames from which to choose -- I hacked at it a while, but had no success, so all I can say is "good luck!" – Aaron Miller Aug 14 '13 at 21:52

For older Emacs releases you can try customizing option display-buffer-reuse-frames.

For recent Emacs releases, i.e., if C-h v display-buffer-alist shows that it exists, you can try customizing that (quite complex) variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.