aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorTom Tromey2013-07-06 23:18:58 -0600
committerTom Tromey2013-07-06 23:18:58 -0600
commit6dacdad5fcb278e5a16b38bb81786aac9ca27be4 (patch)
treef5f331ea361ba0f99e0f9b638d183ad492a7da31 /src/window.c
parent0a6f2ff0c8ceb29703e76cddd46ea3f176dd873a (diff)
parent219afb88d9d484393418820d1c08dc93299110ec (diff)
downloademacs-6dacdad5fcb278e5a16b38bb81786aac9ca27be4.tar.gz
emacs-6dacdad5fcb278e5a16b38bb81786aac9ca27be4.zip
merge from trunk
this merges frmo trunk and fixes various build issues. this needed a few ugly tweaks. this hangs in "make check" now
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c21
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/>. */
55 55
56Lisp_Object Qwindowp, Qwindow_live_p; 56Lisp_Object Qwindowp, Qwindow_live_p;
57static Lisp_Object Qwindow_valid_p; 57static Lisp_Object Qwindow_valid_p;
58static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; 58static Lisp_Object Qwindow_configuration_p;
59static Lisp_Object Qrecord_window_buffer;
59static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; 60static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer;
60static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; 61static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window;
61static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; 62static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically;
@@ -130,6 +131,12 @@ static int window_scroll_pixel_based_preserve_y;
130static EMACS_INT window_scroll_preserve_hpos; 131static EMACS_INT window_scroll_preserve_hpos;
131static EMACS_INT window_scroll_preserve_vpos; 132static EMACS_INT window_scroll_preserve_vpos;
132 133
134static void
135CHECK_WINDOW_CONFIGURATION (Lisp_Object x)
136{
137 CHECK_TYPE (WINDOW_CONFIGURATIONP (x), Qwindow_configuration_p, x);
138}
139
133/* These setters are used only in this file, so they can be private. */ 140/* These setters are used only in this file, so they can be private. */
134static void 141static void
135wset_combination_limit (struct window *w, Lisp_Object val) 142wset_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)
4361 int vscrolled = 0; 4368 int vscrolled = 0;
4362 int x, y, rtop, rbot, rowh, vpos; 4369 int x, y, rtop, rbot, rowh, vpos;
4363 void *itdata = NULL; 4370 void *itdata = NULL;
4371 int window_total_lines;
4372 int frame_line_height = default_line_pixel_height (w);
4364 4373
4365 SET_TEXT_POS_FROM_MARKER (start, w->start); 4374 SET_TEXT_POS_FROM_MARKER (start, w->start);
4366 /* Scrolling a minibuffer window via scroll bar when the echo area 4375 /* 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)
4404 if (rtop || rbot) /* partially visible */ 4413 if (rtop || rbot) /* partially visible */
4405 { 4414 {
4406 int px; 4415 int px;
4407 int dy = WINDOW_FRAME_LINE_HEIGHT (w); 4416 int dy = frame_line_height;
4408 if (whole) 4417 if (whole)
4409 dy = max ((window_box_height (w) 4418 dy = max ((window_box_height (w)
4410 - next_screen_context_lines * dy), 4419 - next_screen_context_lines * dy),
@@ -4490,7 +4499,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4490 if (whole) 4499 if (whole)
4491 { 4500 {
4492 ptrdiff_t start_pos = IT_CHARPOS (it); 4501 ptrdiff_t start_pos = IT_CHARPOS (it);
4493 int dy = WINDOW_FRAME_LINE_HEIGHT (w); 4502 int dy = frame_line_height;
4494 dy = max ((window_box_height (w) 4503 dy = max ((window_box_height (w)
4495 - next_screen_context_lines * dy), 4504 - next_screen_context_lines * dy),
4496 dy) * n; 4505 dy) * n;
@@ -4607,10 +4616,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4607 /* Move PT out of scroll margins. 4616 /* Move PT out of scroll margins.
4608 This code wants current_y to be zero at the window start position 4617 This code wants current_y to be zero at the window start position
4609 even if there is a header line. */ 4618 even if there is a header line. */
4619 window_total_lines
4620 = w->total_lines * WINDOW_FRAME_LINE_HEIGHT (w) / frame_line_height;
4610 this_scroll_margin = max (0, scroll_margin); 4621 this_scroll_margin = max (0, scroll_margin);
4611 this_scroll_margin 4622 this_scroll_margin
4612 = min (this_scroll_margin, w->total_lines / 4); 4623 = min (this_scroll_margin, window_total_lines / 4);
4613 this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); 4624 this_scroll_margin *= frame_line_height;
4614 4625
4615 if (n > 0) 4626 if (n > 0)
4616 { 4627 {