diff options
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/window.c b/src/window.c index a97f1dd3efb..20f6862e3b4 100644 --- a/src/window.c +++ b/src/window.c @@ -5896,22 +5896,23 @@ displayed_window_lines (struct window *w) } -DEFUN ("recenter", Frecenter, Srecenter, 0, 1, "P", +DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "P", doc: /* Center point in selected window and maybe redisplay frame. With a numeric prefix argument ARG, recenter putting point on screen line ARG relative to the selected window. If ARG is negative, it counts up from the bottom of the window. (ARG should be less than the height of the window.) -If ARG is omitted or nil, then recenter with point on the middle line of -the selected window; if the variable `recenter-redisplay' is non-nil, -also erase the entire frame and redraw it (when `auto-resize-tool-bars' -is set to `grow-only', this resets the tool-bar's height to the minimum -height needed); if `recenter-redisplay' has the special value `tty', -then only tty frames are redrawn. +If ARG is omitted or nil, then recenter with point on the middle line +of the selected window; if REDISPLAY & `recenter-redisplay' are +non-nil, also erase the entire frame and redraw it (when +`auto-resize-tool-bars' is set to `grow-only', this resets the +tool-bar's height to the minimum height needed); if +`recenter-redisplay' has the special value `tty', then only tty frames +are redrawn. Just C-u as prefix means put point in the center of the window and redisplay normally--don't erase and redraw the frame. */) - (register Lisp_Object arg) + (Lisp_Object arg, Lisp_Object redisplay) { struct window *w = XWINDOW (selected_window); struct buffer *buf = XBUFFER (w->contents); @@ -5931,7 +5932,8 @@ and redisplay normally--don't erase and redraw the frame. */) if (NILP (arg)) { - if (!NILP (Vrecenter_redisplay) + if (!NILP (redisplay) + && !NILP (Vrecenter_redisplay) && (!EQ (Vrecenter_redisplay, Qtty) || !NILP (Ftty_type (selected_frame)))) { |