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.
Fixes #186.
When the compilation buffer is not displayed at the time
next-error
is invoked, thencompilation-window
ends up nil, andwindow-dedicated-p
andset-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.