aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorKaroly Lorentey2004-11-22 11:06:39 +0000
committerKaroly Lorentey2004-11-22 11:06:39 +0000
commit71925ac335f7c3b1fd97fba98cb5b9b4f03a6e23 (patch)
tree63f61c3bebc83c114c16f31dd4ac2b9c0fe17c7d /src/window.c
parente417405015c93c81641f5c4a33ec898b5c353772 (diff)
parent83aebfe62204109f19ef7dcca5429c1ddad21c57 (diff)
downloademacs-71925ac335f7c3b1fd97fba98cb5b9b4f03a6e23.tar.gz
emacs-71925ac335f7c3b1fd97fba98cb5b9b4f03a6e23.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-694 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-695 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-696 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-697 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-698 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-699 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-700 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-701 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-702 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-703 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-704 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-705 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-706 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-707 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-708 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-709 Update from CVS: src/indent.c (Fvertical_motion): Fix last change. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-710 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-711 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-712 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-713 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-72 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-73 Merge from emacs--cvs-trunk--0 git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-268
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c
index be5e9167d67..b202031878b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -243,7 +243,8 @@ make_window ()
243 register struct window *p; 243 register struct window *p;
244 244
245 p = allocate_window (); 245 p = allocate_window ();
246 XSETFASTINT (p->sequence_number, ++sequence_number); 246 ++sequence_number;
247 XSETFASTINT (p->sequence_number, sequence_number);
247 XSETFASTINT (p->left_col, 0); 248 XSETFASTINT (p->left_col, 0);
248 XSETFASTINT (p->top_line, 0); 249 XSETFASTINT (p->top_line, 0);
249 XSETFASTINT (p->total_lines, 0); 250 XSETFASTINT (p->total_lines, 0);
@@ -2659,6 +2660,9 @@ shrink_windows (total, size, nchildren, shrinkable,
2659 --shrinkable; 2660 --shrinkable;
2660 total_removed += smallest; 2661 total_removed += smallest;
2661 2662
2663 /* We don't know what the smallest is now. */
2664 smallest = total;
2665
2662 /* Out of for, just remove one window at the time and 2666 /* Out of for, just remove one window at the time and
2663 check again if we have enough space. */ 2667 check again if we have enough space. */
2664 break; 2668 break;
@@ -2683,6 +2687,16 @@ shrink_windows (total, size, nchildren, shrinkable,
2683 that are left and still can be shrunk. */ 2687 that are left and still can be shrunk. */
2684 while (total_shrink > total_removed) 2688 while (total_shrink > total_removed)
2685 { 2689 {
2690 int nonzero_sizes = 0;
2691 int nonzero_idx = -1;
2692
2693 for (i = 0; i < nchildren; ++i)
2694 if (new_sizes[i] > 0)
2695 {
2696 ++nonzero_sizes;
2697 nonzero_idx = i;
2698 }
2699
2686 for (i = 0; i < nchildren; ++i) 2700 for (i = 0; i < nchildren; ++i)
2687 if (new_sizes[i] > min_size) 2701 if (new_sizes[i] > min_size)
2688 { 2702 {
@@ -2693,6 +2707,25 @@ shrink_windows (total, size, nchildren, shrinkable,
2693 check again if we have enough space. */ 2707 check again if we have enough space. */
2694 break; 2708 break;
2695 } 2709 }
2710
2711
2712 /* Special case, only one window left. */
2713 if (nonzero_sizes == 1)
2714 break;
2715 }
2716
2717 /* Any surplus due to rounding, we add to windows that are left. */
2718 while (total_shrink < total_removed)
2719 {
2720 for (i = 0; i < nchildren; ++i)
2721 {
2722 if (new_sizes[i] != 0 && total_shrink < total_removed)
2723 {
2724 ++new_sizes[i];
2725 --total_removed;
2726 break;
2727 }
2728 }
2696 } 2729 }
2697 2730
2698 return new_sizes; 2731 return new_sizes;
@@ -3119,7 +3152,8 @@ selects the buffer of the selected window before each command. */)
3119 w = XWINDOW (window); 3152 w = XWINDOW (window);
3120 w->frozen_window_start_p = 0; 3153 w->frozen_window_start_p = 0;
3121 3154
3122 XSETFASTINT (w->use_time, ++window_select_count); 3155 ++window_select_count;
3156 XSETFASTINT (w->use_time, window_select_count);
3123 if (EQ (window, selected_window)) 3157 if (EQ (window, selected_window))
3124 return window; 3158 return window;
3125 3159
@@ -3610,7 +3644,8 @@ make_dummy_parent (window)
3610 = ((struct Lisp_Vector *)o)->contents[i]; 3644 = ((struct Lisp_Vector *)o)->contents[i];
3611 XSETWINDOW (new, p); 3645 XSETWINDOW (new, p);
3612 3646
3613 XSETFASTINT (p->sequence_number, ++sequence_number); 3647 ++sequence_number;
3648 XSETFASTINT (p->sequence_number, sequence_number);
3614 3649
3615 /* Put new into window structure in place of window */ 3650 /* Put new into window structure in place of window */
3616 replace_window (window, new); 3651 replace_window (window, new);
@@ -5852,7 +5887,7 @@ save_window_save (window, vector, i)
5852 p = SAVED_WINDOW_N (vector, i); 5887 p = SAVED_WINDOW_N (vector, i);
5853 w = XWINDOW (window); 5888 w = XWINDOW (window);
5854 5889
5855 XSETFASTINT (w->temslot, i++); 5890 XSETFASTINT (w->temslot, i); i++;
5856 p->window = window; 5891 p->window = window;
5857 p->buffer = w->buffer; 5892 p->buffer = w->buffer;
5858 p->left_col = w->left_col; 5893 p->left_col = w->left_col;