diff options
| author | Dmitry Antipov | 2013-03-28 18:04:49 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-03-28 18:04:49 +0400 |
| commit | e74aeda863cd6896e06e92586f87b45d63d67d15 (patch) | |
| tree | b6a57d0d39f085274c0953623f7d2924f4813db4 /src/frame.c | |
| parent | 9d42d31f24040706fe965e7c586b640471b12861 (diff) | |
| download | emacs-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/frame.c')
| -rw-r--r-- | src/frame.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/frame.c b/src/frame.c index cea39144cef..970e40b5175 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -159,15 +159,15 @@ set_menu_bar_lines_1 (Lisp_Object window, int n) | |||
| 159 | w->total_lines -= n; | 159 | w->total_lines -= n; |
| 160 | 160 | ||
| 161 | /* Handle just the top child in a vertical split. */ | 161 | /* Handle just the top child in a vertical split. */ |
| 162 | if (!NILP (w->vchild)) | 162 | if (WINDOW_VERTICAL_COMBINATION_P (w)) |
| 163 | set_menu_bar_lines_1 (w->vchild, n); | 163 | set_menu_bar_lines_1 (w->contents, n); |
| 164 | 164 | else if (WINDOW_HORIZONTAL_COMBINATION_P (w)) | |
| 165 | /* Adjust all children in a horizontal split. */ | 165 | /* Adjust all children in a horizontal split. */ |
| 166 | for (window = w->hchild; !NILP (window); window = w->next) | 166 | for (window = w->contents; !NILP (window); window = w->next) |
| 167 | { | 167 | { |
| 168 | w = XWINDOW (window); | 168 | w = XWINDOW (window); |
| 169 | set_menu_bar_lines_1 (window, n); | 169 | set_menu_bar_lines_1 (window, n); |
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | void | 173 | void |
| @@ -421,7 +421,7 @@ make_frame_without_minibuffer (register Lisp_Object mini_window, KBOARD *kb, Lis | |||
| 421 | 421 | ||
| 422 | /* Make the chosen minibuffer window display the proper minibuffer, | 422 | /* Make the chosen minibuffer window display the proper minibuffer, |
| 423 | unless it is already showing a minibuffer. */ | 423 | unless it is already showing a minibuffer. */ |
| 424 | if (NILP (Fmemq (XWINDOW (mini_window)->buffer, Vminibuffer_list))) | 424 | if (NILP (Fmemq (XWINDOW (mini_window)->contents, Vminibuffer_list))) |
| 425 | /* Use set_window_buffer instead of Fset_window_buffer (see | 425 | /* Use set_window_buffer instead of Fset_window_buffer (see |
| 426 | discussion of bug#11984, bug#12025, bug#12026). */ | 426 | discussion of bug#11984, bug#12025, bug#12026). */ |
| 427 | set_window_buffer (mini_window, | 427 | set_window_buffer (mini_window, |
| @@ -1189,7 +1189,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 1189 | /* Use set_window_buffer instead of Fset_window_buffer (see | 1189 | /* Use set_window_buffer instead of Fset_window_buffer (see |
| 1190 | discussion of bug#11984, bug#12025, bug#12026). */ | 1190 | discussion of bug#11984, bug#12025, bug#12026). */ |
| 1191 | set_window_buffer (sf->minibuffer_window, | 1191 | set_window_buffer (sf->minibuffer_window, |
| 1192 | XWINDOW (minibuf_window)->buffer, 0, 0); | 1192 | XWINDOW (minibuf_window)->contents, 0, 0); |
| 1193 | minibuf_window = sf->minibuffer_window; | 1193 | minibuf_window = sf->minibuffer_window; |
| 1194 | 1194 | ||
| 1195 | /* If the dying minibuffer window was selected, | 1195 | /* If the dying minibuffer window was selected, |
| @@ -1593,17 +1593,13 @@ make_frame_visible_1 (Lisp_Object window) | |||
| 1593 | { | 1593 | { |
| 1594 | struct window *w; | 1594 | struct window *w; |
| 1595 | 1595 | ||
| 1596 | for (;!NILP (window); window = w->next) | 1596 | for (; !NILP (window); window = w->next) |
| 1597 | { | 1597 | { |
| 1598 | w = XWINDOW (window); | 1598 | w = XWINDOW (window); |
| 1599 | 1599 | if (WINDOWP (w->contents)) | |
| 1600 | if (!NILP (w->buffer)) | 1600 | make_frame_visible_1 (w->contents); |
| 1601 | bset_display_time (XBUFFER (w->buffer), Fcurrent_time ()); | 1601 | else |
| 1602 | 1602 | bset_display_time (XBUFFER (w->contents), Fcurrent_time ()); | |
| 1603 | if (!NILP (w->vchild)) | ||
| 1604 | make_frame_visible_1 (w->vchild); | ||
| 1605 | if (!NILP (w->hchild)) | ||
| 1606 | make_frame_visible_1 (w->hchild); | ||
| 1607 | } | 1603 | } |
| 1608 | } | 1604 | } |
| 1609 | 1605 | ||
| @@ -1634,7 +1630,7 @@ displayed in the terminal. */) | |||
| 1634 | /* Use set_window_buffer instead of Fset_window_buffer (see | 1630 | /* Use set_window_buffer instead of Fset_window_buffer (see |
| 1635 | discussion of bug#11984, bug#12025, bug#12026). */ | 1631 | discussion of bug#11984, bug#12025, bug#12026). */ |
| 1636 | set_window_buffer (sf->minibuffer_window, | 1632 | set_window_buffer (sf->minibuffer_window, |
| 1637 | XWINDOW (minibuf_window)->buffer, 0, 0); | 1633 | XWINDOW (minibuf_window)->contents, 0, 0); |
| 1638 | minibuf_window = sf->minibuffer_window; | 1634 | minibuf_window = sf->minibuffer_window; |
| 1639 | } | 1635 | } |
| 1640 | 1636 | ||
| @@ -1665,7 +1661,7 @@ If omitted, FRAME defaults to the currently selected frame. */) | |||
| 1665 | /* Use set_window_buffer instead of Fset_window_buffer (see | 1661 | /* Use set_window_buffer instead of Fset_window_buffer (see |
| 1666 | discussion of bug#11984, bug#12025, bug#12026). */ | 1662 | discussion of bug#11984, bug#12025, bug#12026). */ |
| 1667 | set_window_buffer (sf->minibuffer_window, | 1663 | set_window_buffer (sf->minibuffer_window, |
| 1668 | XWINDOW (minibuf_window)->buffer, 0, 0); | 1664 | XWINDOW (minibuf_window)->contents, 0, 0); |
| 1669 | minibuf_window = sf->minibuffer_window; | 1665 | minibuf_window = sf->minibuffer_window; |
| 1670 | } | 1666 | } |
| 1671 | 1667 | ||