aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.h
diff options
context:
space:
mode:
authorNoam Postavsky2016-08-28 16:38:04 -0400
committerNoam Postavsky2017-02-02 21:19:52 -0500
commitd17e92da064cabf376597f5de2a8d5a6484bfea6 (patch)
treeb608581cb4e883357a753c12e4526cac53066427 /src/window.h
parent53c16c75a57aa486dfc1f46ef5aa538264e6ad47 (diff)
downloademacs-d17e92da064cabf376597f5de2a8d5a6484bfea6.tar.gz
emacs-d17e92da064cabf376597f5de2a8d5a6484bfea6.zip
Refactor uses of scroll_margin to a function
Its effective range needs to be clamped between 0 and (window height / 4), so it's better to have this constraint in a single place. * src/window.c (window_scroll_margin): New function. (window_scroll_pixel_based, window_scroll_line_based): (Frecenter, Fmove_to_window_line): * src/xdisp.c (try_scrolling, try_cursor_movement): (redisplay_window, try_window, try_window_id): Use it.
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h
index 061cf244943..acb8a5cabfa 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1120,6 +1120,8 @@ extern bool compare_window_configurations (Lisp_Object, Lisp_Object, bool);
1120extern void mark_window_cursors_off (struct window *); 1120extern void mark_window_cursors_off (struct window *);
1121extern int window_internal_height (struct window *); 1121extern int window_internal_height (struct window *);
1122extern int window_body_width (struct window *w, bool); 1122extern int window_body_width (struct window *w, bool);
1123enum margin_unit { MARGIN_IN_LINES, MARGIN_IN_PIXELS };
1124extern int window_scroll_margin (struct window *, enum margin_unit);
1123extern void temp_output_buffer_show (Lisp_Object); 1125extern void temp_output_buffer_show (Lisp_Object);
1124extern void replace_buffer_in_windows (Lisp_Object); 1126extern void replace_buffer_in_windows (Lisp_Object);
1125extern void replace_buffer_in_windows_safely (Lisp_Object); 1127extern void replace_buffer_in_windows_safely (Lisp_Object);