Function: other-window-for-scrolling
other-window-for-scrolling is a function defined in window.c.
Signature
(other-window-for-scrolling)
Documentation
Return the other window for "other window scroll" commands.
If in the minibuffer, minibuffer-scroll-window if non-nil
specifies the window.
Otherwise, if other-window-scroll-buffer is non-nil, a window
showing that buffer is used, popping the buffer up if necessary.
Finally, look for a neighboring window on the selected frame,
followed by all visible frames on the current terminal.
Probably introduced at or before Emacs version 19.26.
Source Code
// Defined in /usr/src/emacs/src/window.c
{
Lisp_Object window;
if (MINI_WINDOW_P (XWINDOW (selected_window))
&& !NILP (Vminibuf_scroll_window))
window = Vminibuf_scroll_window;
/* If buffer is specified and live, scroll that buffer. */
else if (BUFFERP (Vother_window_scroll_buffer)
&& BUFFER_LIVE_P (XBUFFER (Vother_window_scroll_buffer)))
{
window = Fget_buffer_window (Vother_window_scroll_buffer, Qnil);
if (NILP (window))
window = display_buffer (Vother_window_scroll_buffer, Qt, Qnil);
}
else
{
/* Nothing specified; look for a neighboring window on the same
frame. */
window = Fnext_window (selected_window, Qlambda, Qnil);
if (EQ (window, selected_window))
/* That didn't get us anywhere; look for a window on another
visible frame on the current terminal. */
window = Fnext_window (window, Qlambda, Qvisible);
}
CHECK_LIVE_WINDOW (window);
if (EQ (window, selected_window))
error ("There is no other window");
return window;
}