bmag / emacs-purpose

Manage Windows and Buffers According to Purposes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

purpose-switch-buffer-with-purpose with multiple frames

se7entyse7en opened this issue · comments

I have another frame with a single window containing a buffer with mode magit-status-mode. I dedicated this window to this mode. Anyway if from the other frame I try to open another buffer with the magit-status-mode, it isn't opened in the dedicated window of the other frame. Everything works fine if the dedicated window is in the same frame.

commented

You probably have pop-up-frames set to nil. Setting it to t or graphic-only should fix it.

Thanks for the fast response! Anyway it doesn't fix the issue, I try to explain better using some ASCII art :). Here's my current layout:

        frame 1                  frame 2
***********************     ****************  
* window 1 * window 2 *     *    window3   *
*          *          *     *              *
*   file   *   file   *     * magit-status *
* of proj1 * of proj2 *     *              *
*          *          *     *              *
***********************     ****************

where frame 1 is in a monitor and frame 2 is in another monitor (dual monitor setup). I dedicated window 3 to magit-status by adding this in the emacs configuration:

(add-to-list 'purpose-user-mode-purposes '(magit-status-mode . magit-status)

If from frame 1 I try to open a magit-status buffer it's not being opened in window 3 as expected. On the other hand if I split frame 2, by adding window 4, and I try to open a magit-status buffer it's opened in window 3 as expected. So it seems that the window "dedication" have some sort of frame scope.


As for extra infos:
Emacs version: GNU Emacs 25.3.1
OS: MacOS High Sierra

Frame 1 is in full screen on first monitor.
Frame 2 is in full screen on second monitor, but in split screen (native os split screen).

commented

Window dedication doesn't have frame scope. If pop-up-frames is nil, then Purpose will avoid displaying buffer in new/other frames, even if there's a window with a matching purpose in one of them. That's why I suggested setting pop-up-frames to t or graphic-only.

That said, it's possible for code to by-pass Purpose (and the normal display-buffer configuration) entirely, and I suppose that's the case here. To help further, I will need you to post detailed bug-reproduction steps and explain exactly where things go wrong.

For example, it might look something like this:

  • start emacs (with window-purpose and magit configured in some way that needs to be listed)
  • open buffer in new frame: C-x 5 b foo RET
  • M-x magit-status
  • switch to first frame: C-x 5 o
  • M-x magit-status: status buffer is shown in first frame instead of second frame

Also, don't forget that you need to call purpose-compile-user-configuration after modifying purpose-user-mode-purposes.