bmag / emacs-purpose

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

Only dedicate compilation buffer if it is being displayed #187

Closed bcc32 closed 3 years ago

bcc32 commented 3 years ago

Fixes #186.

When the compilation buffer is not displayed at the time next-error is invoked, then compilation-window ends up nil, and window-dedicated-p and set-window-dedicated-p end up operating on whatever window happens to be selected.

This ends up being two different windows if next-error moves to a different buffer, and so the dedicated-ness of the windows is not correctly preserved.

Fix by only attempting to make the window dedicated if compilation-window is non-nil.

bmag commented 3 years ago

Thank you very much!