diff options
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/lisp/window.el b/lisp/window.el index 8905d4a826e..2d0a73b426d 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9733,13 +9733,16 @@ cycling order is middle -> top -> bottom." :group 'windows) (defun recenter-top-bottom (&optional arg) - "Move current buffer line to the specified window line. -With no prefix argument, successive calls place point according -to the cycling order defined by `recenter-positions'. - -A prefix argument is handled like `recenter': - With numeric prefix ARG, move current line to window-line ARG. - With plain `C-u', move current line to window center." + "Scroll the window so that current line is in the middle of the window. +Successive invocations scroll the window in a cyclical order to put +the current line at certain places within the window, as determined by +`recenter-positions'. By default, the second invocation puts the +current line at the top-most window line, the third invocation puts it +on the bottom-most window line, and then the order is reused in a +cyclical manner. + +With numeric prefix ARG, move current line ARG lines below the window top. +With plain \\[universal-argument], move current line to window center." (interactive "P") (cond (arg (recenter arg t)) ; Always respect ARG. @@ -9765,6 +9768,19 @@ A prefix argument is handled like `recenter': (define-key global-map [?\C-l] 'recenter-top-bottom) +(defun recenter-other-window (&optional arg) + "Call `recenter-top-bottom' in the other window. + +A prefix argument is handled like `recenter': + With numeric prefix ARG, move current line to window-line ARG. + With plain `C-u', move current line to window center." + (interactive "P") + (with-selected-window (other-window-for-scrolling) + (recenter-top-bottom arg) + (pulse-momentary-highlight-one-line (point)))) + +(define-key global-map [?\S-\M-\C-l] 'recenter-other-window) + (defun move-to-window-line-top-bottom (&optional arg) "Position point relative to window. |