diff options
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c index 81a2285edba..ba9728f09af 100644 --- a/src/window.c +++ b/src/window.c @@ -55,7 +55,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ Lisp_Object Qwindowp, Qwindow_live_p; static Lisp_Object Qwindow_valid_p; -static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; +static Lisp_Object Qwindow_configuration_p; +static Lisp_Object Qrecord_window_buffer; static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; @@ -130,6 +131,12 @@ static int window_scroll_pixel_based_preserve_y; static EMACS_INT window_scroll_preserve_hpos; static EMACS_INT window_scroll_preserve_vpos; +static void +CHECK_WINDOW_CONFIGURATION (Lisp_Object x) +{ + CHECK_TYPE (WINDOW_CONFIGURATIONP (x), Qwindow_configuration_p, x); +} + /* These setters are used only in this file, so they can be private. */ static void wset_combination_limit (struct window *w, Lisp_Object val) @@ -4361,6 +4368,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) int vscrolled = 0; int x, y, rtop, rbot, rowh, vpos; void *itdata = NULL; + int window_total_lines; + int frame_line_height = default_line_pixel_height (w); SET_TEXT_POS_FROM_MARKER (start, w->start); /* Scrolling a minibuffer window via scroll bar when the echo area @@ -4404,7 +4413,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) if (rtop || rbot) /* partially visible */ { int px; - int dy = WINDOW_FRAME_LINE_HEIGHT (w); + int dy = frame_line_height; if (whole) dy = max ((window_box_height (w) - next_screen_context_lines * dy), @@ -4490,7 +4499,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) if (whole) { ptrdiff_t start_pos = IT_CHARPOS (it); - int dy = WINDOW_FRAME_LINE_HEIGHT (w); + int dy = frame_line_height; dy = max ((window_box_height (w) - next_screen_context_lines * dy), dy) * n; @@ -4607,10 +4616,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) /* Move PT out of scroll margins. This code wants current_y to be zero at the window start position even if there is a header line. */ + window_total_lines + = w->total_lines * WINDOW_FRAME_LINE_HEIGHT (w) / frame_line_height; this_scroll_margin = max (0, scroll_margin); this_scroll_margin - = min (this_scroll_margin, w->total_lines / 4); - this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); + = min (this_scroll_margin, window_total_lines / 4); + this_scroll_margin *= frame_line_height; if (n > 0) { |