bmag / emacs-purpose

Manage Windows and Buffers According to Purposes
GNU General Public License v3.0
498 stars 23 forks source link

purpose-switch-buffer-with-purpose with multiple frames #115

Closed se7entyse7en closed 6 years ago

se7entyse7en commented 7 years ago

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.

bmag commented 7 years ago

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

se7entyse7en commented 7 years ago

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).

bmag commented 7 years ago

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:

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