[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 730ad4a373: Make scroll-other-window respect target window remapp
From: |
Lars Ingebrigtsen |
Subject: |
master 730ad4a373: Make scroll-other-window respect target window remappings |
Date: |
Sun, 1 May 2022 06:47:47 -0400 (EDT) |
branch: master
commit 730ad4a3733203d24c9d0a8db6fde0aa087034ca
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Make scroll-other-window respect target window remappings
* lisp/window.el (scroll-other-window, scroll-other-window-down):
Moved from window.c and change implementation so that they respect
command remappings in the target window (bug#20236).
---
etc/NEWS | 9 +++++++++
lisp/window.el | 18 ++++++++++++++++++
src/window.c | 32 --------------------------------
3 files changed, 27 insertions(+), 32 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index fc7432669c..88b4e59e26 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -586,6 +586,15 @@ available options can be restored by enabling this option.
* Editing Changes in Emacs 29.1
+---
+** 'scroll-other-window' and 'scroll-other-window-down' now respects remapping.
+These commands (bound to 'C-M-v' and 'C-M-V') used to scroll the other
+windows without looking a customizations in that other window. These
+functions now check whether they have been rebound in the buffer in
+that other window, and then call the remapped function instead. In
+addition, these commands now also respect the
+'scroll-error-top-bottom' user option.
+
---
** Indentation of 'cl-flet' and 'cl-labels' has changed.
These forms now indent like this:
diff --git a/lisp/window.el b/lisp/window.el
index 5ceec77bd3..9f78784612 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10093,6 +10093,24 @@ If ARG is the atom `-', scroll upward by nearly full
screen."
(put 'scroll-down-command 'scroll-command t)
+(defun scroll-other-window (&optional lines)
+ "Scroll next window upward LINES lines; or near full screen if no ARG.
+See `scroll-up-command' for details."
+ (interactive "P")
+ (with-selected-window (other-window-for-scrolling)
+ (funcall (or (command-remapping #'scroll-up-command)
+ #'scroll-up-command)
+ lines)))
+
+(defun scroll-other-window-down (&optional lines)
+ "Scroll next window downward LINES lines; or near full screen if no ARG.
+See `scroll-down-command' for details."
+ (interactive "P")
+ (with-selected-window (other-window-for-scrolling)
+ (funcall (or (command-remapping #'scroll-down-command)
+ #'scroll-down-command)
+ lines)))
+
;;; Scrolling commands which scroll a line instead of full screen.
(defun scroll-up-line (&optional arg)
diff --git a/src/window.c b/src/window.c
index cfe3977428..6d28384eeb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6334,36 +6334,6 @@ followed by all visible frames on the current terminal.
*/)
return window;
}
-DEFUN ("scroll-other-window", Fscroll_other_window, Sscroll_other_window, 0,
1, "P",
- doc: /* Scroll next window upward ARG lines; or near full screen if no
ARG.
-A near full screen is `next-screen-context-lines' less than a full screen.
-Negative ARG means scroll downward. If ARG is the atom `-', scroll
-downward by nearly full screen. When calling from a program, supply
-as argument a number, nil, or `-'.
-
-The next window is usually the one below the current one;
-or the one at the top if the current one is at the bottom.
-It is determined by the function `other-window-for-scrolling',
-which see.
-
-Also see the `other-window-scroll-default' variable. */)
- (Lisp_Object arg)
-{
- specpdl_ref count = SPECPDL_INDEX ();
- scroll_command (Fother_window_for_scrolling (), arg, 1);
- return unbind_to (count, Qnil);
-}
-
-DEFUN ("scroll-other-window-down", Fscroll_other_window_down,
- Sscroll_other_window_down, 0, 1, "P",
- doc: /* Scroll next window downward ARG lines; or near full screen if
no ARG.
-For more details, see the documentation for `scroll-other-window'. */)
- (Lisp_Object arg)
-{
- specpdl_ref count = SPECPDL_INDEX ();
- scroll_command (Fother_window_for_scrolling (), arg, -1);
- return unbind_to (count, Qnil);
-}
DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 2, "^P\np",
doc: /* Scroll selected window display ARG columns left.
@@ -8608,8 +8578,6 @@ displayed after a scrolling operation to be somewhat
inaccurate. */);
defsubr (&Sscroll_left);
defsubr (&Sscroll_right);
defsubr (&Sother_window_for_scrolling);
- defsubr (&Sscroll_other_window);
- defsubr (&Sscroll_other_window_down);
defsubr (&Sminibuffer_selected_window);
defsubr (&Srecenter);
defsubr (&Swindow_text_width);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 730ad4a373: Make scroll-other-window respect target window remappings,
Lars Ingebrigtsen <=