I am trying to figure out if we can disable a particular window from switching the buffer it contains. If anyone has achieved that please share.
Yes. It's called a dedicated window.
See the Elisp manual, node Dedicated Windows.
C-h f set-window-dedicated-p tells you:
set-window-dedicated-pis a built-in function in
C source code.
(set-window-dedicated-p WINDOW FLAG)
WINDOWas dedicated according to
WINDOWmust be a live window and defaults to the selected one.
WINDOWas dedicated to its buffer. FLAG nil means mark
WINDOWas non-dedicated. Return
When a window is dedicated to its buffer,
display-bufferwill refrain from displaying another buffer in it.
get-largest-windowtreat dedicated windows specially.
kill-buffercan delete a dedicated window and the containing frame.
As a special case, if
WINDOWas "strongly" dedicated to its buffer. Functions like
set-window-buffermay change the buffer displayed by a window, unless that window is strongly dedicated to its buffer. If and when
set-window-bufferdisplays another buffer in a window, it also makes sure that the window is no more dedicated.