aboutsummaryrefslogtreecommitdiffstats
path: root/src/fringe.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-03-28 18:04:49 +0400
committerDmitry Antipov2013-03-28 18:04:49 +0400
commite74aeda863cd6896e06e92586f87b45d63d67d15 (patch)
treeb6a57d0d39f085274c0953623f7d2924f4813db4 /src/fringe.c
parent9d42d31f24040706fe965e7c586b640471b12861 (diff)
downloademacs-e74aeda863cd6896e06e92586f87b45d63d67d15.tar.gz
emacs-e74aeda863cd6896e06e92586f87b45d63d67d15.zip
* window.h (struct window): Replace hchild, vchild and buffer slots
with the only contents slot. This is possible because each valid window may have either the child window (in vertical or horizontal combination) or buffer to display (for the leaf window). Using that, a lof of operations to traverse and/or change window hierarchies may be simplified. New member horizontal is used to distinguish between horizontal and vertical combinations of internal windows. (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P) (WINDOW_VERTICAL_COMBINATION_P): New macros. (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes. * window.c (wset_hchild, wset_vchild): Remove. Adjust all users. Use contents slot, not buffer, where appropriate. (wset_combination): New function. (wset_buffer): Add eassert. (Fframe_first_window): Simplify the loop reaching first window. (Fwindow_buffer): Use WINDOW_LEAF_P. (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P. (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P. (unshow_buffer): Convert initial debugging check to eassert. (replace_window, recombine_windows, Fdelete_other_windows_internal) (make_parent_window, window_resize_check, window_resize_apply) (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal) (Fset_window_configuration, delete_all_child_windows, save_window_save): Adjust to match struct window changes. (window_loop): Check for broken markers in CHECK_ALL_WINDOWS. (mark_window_cursors_off, count_windows, get_leaf_windows) (foreach_window_1): Simplify the loop. * alloc.c (mark_object): Do not check for the leaf window because internal windows has no glyph matrices anyway. * dispnew.c (clear_window_matrices, showing_window_margins_p) (allocate_matrices_for_window_redisplay, fake_current_matrices) (allocate_matrices_for_frame_redisplay, free_window_matrices) (build_frame_matrix_from_window_tree, mirror_make_current) (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers) (update_window_tree, set_window_update_flags): Simplify the loop. (sync_window_with_frame_matrix_rows): Enforce live window. Use contents slot, not buffer, where appropriate. * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P and WINDOW_HORIZONTAL_COMBINATION_P. (make_frame_visible_1): Simplify the loop. Use contents slot, not buffer, where appropriate. * xdisp.c (hscroll_window_tree, mark_window_display_accurate) (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree) (expose_window_tree): Likewise. Use contents slot, not buffer, where appropriate. * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW to avoid deleted windows. Use contents slot instead of buffer. * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c: * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c: * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c: * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
Diffstat (limited to 'src/fringe.c')
-rw-r--r--src/fringe.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fringe.c b/src/fringe.c
index fa6f889ba69..f728cd6d5ff 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -699,7 +699,7 @@ get_logical_cursor_bitmap (struct window *w, Lisp_Object cursor)
699{ 699{
700 Lisp_Object cmap, bm = Qnil; 700 Lisp_Object cmap, bm = Qnil;
701 701
702 if ((cmap = BVAR (XBUFFER (w->buffer), fringe_cursor_alist)), !NILP (cmap)) 702 if ((cmap = BVAR (XBUFFER (w->contents), fringe_cursor_alist)), !NILP (cmap))
703 { 703 {
704 bm = Fassq (cursor, cmap); 704 bm = Fassq (cursor, cmap);
705 if (CONSP (bm)) 705 if (CONSP (bm))
@@ -736,7 +736,7 @@ get_logical_fringe_bitmap (struct window *w, Lisp_Object bitmap, int right_p, in
736 If partial, lookup partial bitmap in default value if not found here. 736 If partial, lookup partial bitmap in default value if not found here.
737 If not partial, or no partial spec is present, use non-partial bitmap. */ 737 If not partial, or no partial spec is present, use non-partial bitmap. */
738 738
739 if ((cmap = BVAR (XBUFFER (w->buffer), fringe_indicator_alist)), !NILP (cmap)) 739 if ((cmap = BVAR (XBUFFER (w->contents), fringe_indicator_alist)), !NILP (cmap))
740 { 740 {
741 bm1 = Fassq (bitmap, cmap); 741 bm1 = Fassq (bitmap, cmap);
742 if (CONSP (bm1)) 742 if (CONSP (bm1))
@@ -963,7 +963,7 @@ update_window_fringes (struct window *w, int keep_current_p)
963 return 0; 963 return 0;
964 964
965 if (!MINI_WINDOW_P (w) 965 if (!MINI_WINDOW_P (w)
966 && (ind = BVAR (XBUFFER (w->buffer), indicate_buffer_boundaries), !NILP (ind))) 966 && (ind = BVAR (XBUFFER (w->contents), indicate_buffer_boundaries), !NILP (ind)))
967 { 967 {
968 if (EQ (ind, Qleft) || EQ (ind, Qright)) 968 if (EQ (ind, Qleft) || EQ (ind, Qright))
969 boundary_top = boundary_bot = arrow_top = arrow_bot = ind; 969 boundary_top = boundary_bot = arrow_top = arrow_bot = ind;
@@ -1004,7 +1004,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1004 { 1004 {
1005 if (top_ind_rn < 0 && row->visible_height > 0) 1005 if (top_ind_rn < 0 && row->visible_height > 0)
1006 { 1006 {
1007 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->buffer)) 1007 if (MATRIX_ROW_START_CHARPOS (row) <= BUF_BEGV (XBUFFER (w->contents))
1008 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) 1008 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
1009 row->indicate_bob_p = !NILP (boundary_top); 1009 row->indicate_bob_p = !NILP (boundary_top);
1010 else 1010 else
@@ -1014,7 +1014,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1014 1014
1015 if (bot_ind_rn < 0) 1015 if (bot_ind_rn < 0)
1016 { 1016 {
1017 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->buffer)) 1017 if (MATRIX_ROW_END_CHARPOS (row) >= BUF_ZV (XBUFFER (w->contents))
1018 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) 1018 && !MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row))
1019 row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn; 1019 row->indicate_eob_p = !NILP (boundary_bot), bot_ind_rn = rn;
1020 else if (y + row->height >= yb) 1020 else if (y + row->height >= yb)
@@ -1024,7 +1024,7 @@ update_window_fringes (struct window *w, int keep_current_p)
1024 } 1024 }
1025 } 1025 }
1026 1026
1027 empty_pos = BVAR (XBUFFER (w->buffer), indicate_empty_lines); 1027 empty_pos = BVAR (XBUFFER (w->contents), indicate_empty_lines);
1028 if (!NILP (empty_pos) && !EQ (empty_pos, Qright)) 1028 if (!NILP (empty_pos) && !EQ (empty_pos, Qright))
1029 empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft; 1029 empty_pos = WINDOW_LEFT_FRINGE_WIDTH (w) == 0 ? Qright : Qleft;
1030 1030