emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ecdda194a8: * src/window.c (other-window-scroll-default): New var


From: Juri Linkov
Subject: master ecdda194a8: * src/window.c (other-window-scroll-default): New variable (bug#51210).
Date: Tue, 11 Jan 2022 12:29:34 -0500 (EST)

branch: master
commit ecdda194a82c8c52bdb948160f55ebbabe733d79
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * src/window.c (other-window-scroll-default): New variable (bug#51210).
    
    (Fother_window_for_scrolling): Use it.
---
 etc/NEWS     |  2 ++
 src/window.c | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index d256342f43..d7281467c6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -269,6 +269,8 @@ For example, a 'display-buffer-alist' entry of
 will make the body of the chosen window 40 columns wide.  For the
 height use 'window-height' in combination with 'body-lines'.
 
+*** 'other-window-scroll-default' can define the other window to scroll.
+
 ** Rcirc
 
 +++
diff --git a/src/window.c b/src/window.c
index 1e7c26b82e..7155f0e6bc 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6307,10 +6307,12 @@ followed by all visible frames on the current terminal. 
 */)
       if (NILP (window))
        window = display_buffer (Vother_window_scroll_buffer, Qt, Qnil);
     }
+  else if (FUNCTIONP (Vother_window_scroll_default))
+    /* Nothing specified; try to get a window from the function.  */
+    window = call0 (Vother_window_scroll_default);
   else
     {
-      /* Nothing specified; look for a neighboring window on the same
-        frame.  */
+      /* Otherwise, look for a neighboring window on the same frame.  */
       window = Fnext_window (selected_window, Qlambda, Qnil);
 
       if (EQ (window, selected_window))
@@ -8268,6 +8270,14 @@ is displayed in the `mode-line' face.  */);
               doc: /* If this is a live buffer, \\[scroll-other-window] should 
scroll its window.  */);
   Vother_window_scroll_buffer = Qnil;
 
+  DEFVAR_LISP ("other-window-scroll-default", Vother_window_scroll_default,
+              doc: /* Function that provides the window to scroll by 
\\[scroll-other-window].
+The function `other-window-for-scrolling' first tries to use
+`minibuffer-scroll-window' and `other-window-scroll-buffer'.
+But when both are nil, then by default it uses a neighboring window.
+This variable is intended to get another default instead of `next-window'.  
*/);
+  Vother_window_scroll_default = Qnil;
+
   DEFVAR_BOOL ("auto-window-vscroll", auto_window_vscroll_p,
               doc: /* Non-nil means to automatically adjust `window-vscroll' 
to view tall lines.  */);
   auto_window_vscroll_p = true;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]