aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-27 20:32:56 +0200
committerMartin Rudalics2011-06-27 20:32:56 +0200
commitd615d6d2887f159f1a7337be7bd175ce22013e1f (patch)
treedaa3b9ed6ec8f32ee0b1b93ec2d93e4b324274c3 /src/window.c
parent945152374eaba9c794ec04bb0474e49343c63b23 (diff)
downloademacs-d615d6d2887f159f1a7337be7bd175ce22013e1f.tar.gz
emacs-d615d6d2887f159f1a7337be7bd175ce22013e1f.zip
Use window- prefix more consistently. Fix two buffer display bugs.
* window.c (resize_window_check): Rename to window_resize_check. (resize_window_apply): Rename to window_resize_apply. (Fresize_window_apply): Rename to Fwindow_resize_apply. (Fdelete_other_windows_internal, resize_frame_windows) (Fsplit_window_internal, Fdelete_window_internal) (grow_mini_window, shrink_mini_window) (Fresize_mini_window_internal): Fix callers accordingly. * window.el (resize-window-reset): Rename to window-resize-reset. (resize-window-reset-1): Rename to window-resize-reset-1. (resize-window): Rename to window-resize. (window-min-height, window-min-width) (resize-mini-window, resize-this-window, resize-root-window) (resize-root-window-vertically, adjust-window-trailing-edge) (enlarge-window, shrink-window, maximize-window) (minimize-window, delete-window, quit-restore-window) (split-window, balance-windows, balance-windows-area-adjust) (balance-windows-area, window-state-put-2) (display-buffer-even-window-sizes, display-buffer-set-height) (display-buffer-set-width, set-window-text-height) (fit-window-to-buffer): Rename all "resize-window" prefixed calls to use the "window-resize" prefix convention. (display-buffer-alist): Fix symbol for label specifier. (display-buffer-reuse-window): Set reuse-dedicated to cdr of corresponding specifier. Reported by Juanma Barranquero <lekktu@gmail.com>.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/window.c b/src/window.c
index 19b3edf4c77..6656796b350 100644
--- a/src/window.c
+++ b/src/window.c
@@ -82,8 +82,8 @@ static int foreach_window_1 (struct window *,
82 int (* fn) (struct window *, void *), 82 int (* fn) (struct window *, void *),
83 void *); 83 void *);
84static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object); 84static Lisp_Object window_list_1 (Lisp_Object, Lisp_Object, Lisp_Object);
85static int resize_window_check (struct window *, int); 85static int window_resize_check (struct window *, int);
86static void resize_window_apply (struct window *, int); 86static void window_resize_apply (struct window *, int);
87static Lisp_Object select_window (Lisp_Object, Lisp_Object, int); 87static Lisp_Object select_window (Lisp_Object, Lisp_Object, int);
88 88
89/* This is the window in which the terminal's cursor should 89/* This is the window in which the terminal's cursor should
@@ -2695,13 +2695,13 @@ window-start value is reasonable when this function is called. */)
2695 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines)); 2695 XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines));
2696 w->top_line = r->top_line; 2696 w->top_line = r->top_line;
2697 resize_root_window (window, delta, Qnil, Qnil); 2697 resize_root_window (window, delta, Qnil, Qnil);
2698 if (resize_window_check (w, 0)) 2698 if (window_resize_check (w, 0))
2699 resize_window_apply (w, 0); 2699 window_resize_apply (w, 0);
2700 else 2700 else
2701 { 2701 {
2702 resize_root_window (window, delta, Qnil, Qt); 2702 resize_root_window (window, delta, Qnil, Qt);
2703 if (resize_window_check (w, 0)) 2703 if (window_resize_check (w, 0))
2704 resize_window_apply (w, 0); 2704 window_resize_apply (w, 0);
2705 else 2705 else
2706 resize_failed = 1; 2706 resize_failed = 1;
2707 } 2707 }
@@ -2713,13 +2713,13 @@ window-start value is reasonable when this function is called. */)
2713 XSETINT (delta, XINT (r->total_cols) - XINT (w->total_cols)); 2713 XSETINT (delta, XINT (r->total_cols) - XINT (w->total_cols));
2714 w->left_col = r->left_col; 2714 w->left_col = r->left_col;
2715 resize_root_window (window, delta, Qt, Qnil); 2715 resize_root_window (window, delta, Qt, Qnil);
2716 if (resize_window_check (w, 1)) 2716 if (window_resize_check (w, 1))
2717 resize_window_apply (w, 1); 2717 window_resize_apply (w, 1);
2718 else 2718 else
2719 { 2719 {
2720 resize_root_window (window, delta, Qt, Qt); 2720 resize_root_window (window, delta, Qt, Qt);
2721 if (resize_window_check (w, 1)) 2721 if (window_resize_check (w, 1))
2722 resize_window_apply (w, 1); 2722 window_resize_apply (w, 1);
2723 else 2723 else
2724 resize_failed = 1; 2724 resize_failed = 1;
2725 } 2725 }
@@ -3415,7 +3415,7 @@ Note: This function does not operate on any subwindows of WINDOW. */)
3415 `window-min-height' or `window-min-width'. It does check that window 3415 `window-min-height' or `window-min-width'. It does check that window
3416 sizes do not drop below one line (two columns). */ 3416 sizes do not drop below one line (two columns). */
3417static int 3417static int
3418resize_window_check (struct window *w, int horflag) 3418window_resize_check (struct window *w, int horflag)
3419{ 3419{
3420 struct window *c; 3420 struct window *c;
3421 3421
@@ -3429,7 +3429,7 @@ resize_window_check (struct window *w, int horflag)
3429 while (c) 3429 while (c)
3430 { 3430 {
3431 if ((XINT (c->new_total) != XINT (w->new_total)) 3431 if ((XINT (c->new_total) != XINT (w->new_total))
3432 || !resize_window_check (c, horflag)) 3432 || !window_resize_check (c, horflag))
3433 return 0; 3433 return 0;
3434 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3434 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3435 } 3435 }
@@ -3442,7 +3442,7 @@ resize_window_check (struct window *w, int horflag)
3442 int sum_of_sizes = 0; 3442 int sum_of_sizes = 0;
3443 while (c) 3443 while (c)
3444 { 3444 {
3445 if (!resize_window_check (c, horflag)) 3445 if (!window_resize_check (c, horflag))
3446 return 0; 3446 return 0;
3447 sum_of_sizes = sum_of_sizes + XINT (c->new_total); 3447 sum_of_sizes = sum_of_sizes + XINT (c->new_total);
3448 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3448 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3461,7 +3461,7 @@ resize_window_check (struct window *w, int horflag)
3461 int sum_of_sizes = 0; 3461 int sum_of_sizes = 0;
3462 while (c) 3462 while (c)
3463 { 3463 {
3464 if (!resize_window_check (c, horflag)) 3464 if (!window_resize_check (c, horflag))
3465 return 0; 3465 return 0;
3466 sum_of_sizes = sum_of_sizes + XINT (c->new_total); 3466 sum_of_sizes = sum_of_sizes + XINT (c->new_total);
3467 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3467 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3474,7 +3474,7 @@ resize_window_check (struct window *w, int horflag)
3474 while (c) 3474 while (c)
3475 { 3475 {
3476 if ((XINT (c->new_total) != XINT (w->new_total)) 3476 if ((XINT (c->new_total) != XINT (w->new_total))
3477 || !resize_window_check (c, horflag)) 3477 || !window_resize_check (c, horflag))
3478 return 0; 3478 return 0;
3479 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3479 c = NILP (c->next) ? 0 : XWINDOW (c->next);
3480 } 3480 }
@@ -3494,9 +3494,9 @@ resize_window_check (struct window *w, int horflag)
3494 each of these windows. 3494 each of these windows.
3495 3495
3496 This function does not perform any error checks. Make sure you have 3496 This function does not perform any error checks. Make sure you have
3497 run resize_window_check on W before applying this function. */ 3497 run window_resize_check on W before applying this function. */
3498static void 3498static void
3499resize_window_apply (struct window *w, int horflag) 3499window_resize_apply (struct window *w, int horflag)
3500{ 3500{
3501 struct window *c; 3501 struct window *c;
3502 int pos; 3502 int pos;
@@ -3530,7 +3530,7 @@ resize_window_apply (struct window *w, int horflag)
3530 XSETFASTINT (c->left_col, pos); 3530 XSETFASTINT (c->left_col, pos);
3531 else 3531 else
3532 XSETFASTINT (c->top_line, pos); 3532 XSETFASTINT (c->top_line, pos);
3533 resize_window_apply (c, horflag); 3533 window_resize_apply (c, horflag);
3534 if (!horflag) 3534 if (!horflag)
3535 pos = pos + XINT (c->total_lines); 3535 pos = pos + XINT (c->total_lines);
3536 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3536 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3546,7 +3546,7 @@ resize_window_apply (struct window *w, int horflag)
3546 XSETFASTINT (c->left_col, pos); 3546 XSETFASTINT (c->left_col, pos);
3547 else 3547 else
3548 XSETFASTINT (c->top_line, pos); 3548 XSETFASTINT (c->top_line, pos);
3549 resize_window_apply (c, horflag); 3549 window_resize_apply (c, horflag);
3550 if (horflag) 3550 if (horflag)
3551 pos = pos + XINT (c->total_cols); 3551 pos = pos + XINT (c->total_cols);
3552 c = NILP (c->next) ? 0 : XWINDOW (c->next); 3552 c = NILP (c->next) ? 0 : XWINDOW (c->next);
@@ -3559,7 +3559,7 @@ resize_window_apply (struct window *w, int horflag)
3559} 3559}
3560 3560
3561 3561
3562DEFUN ("resize-window-apply", Fresize_window_apply, Sresize_window_apply, 1, 2, 0, 3562DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 1, 2, 0,
3563 doc: /* Apply requested size values for window-tree of FRAME. 3563 doc: /* Apply requested size values for window-tree of FRAME.
3564Optional argument HORIZONTAL omitted or nil means apply requested height 3564Optional argument HORIZONTAL omitted or nil means apply requested height
3565values. HORIZONTAL non-nil means apply requested width values. 3565values. HORIZONTAL non-nil means apply requested width values.
@@ -3584,12 +3584,12 @@ be applied on the Elisp level. */)
3584 f = XFRAME (frame); 3584 f = XFRAME (frame);
3585 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 3585 r = XWINDOW (FRAME_ROOT_WINDOW (f));
3586 3586
3587 if (!resize_window_check (r, horflag) 3587 if (!window_resize_check (r, horflag)
3588 || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) 3588 || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines)))
3589 return Qnil; 3589 return Qnil;
3590 3590
3591 BLOCK_INPUT; 3591 BLOCK_INPUT;
3592 resize_window_apply (r, horflag); 3592 window_resize_apply (r, horflag);
3593 3593
3594 windows_or_buffers_changed++; 3594 windows_or_buffers_changed++;
3595 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3595 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
@@ -3641,22 +3641,22 @@ resize_frame_windows (struct frame *f, int size, int horflag)
3641 XSETINT (delta, new_size - old_size); 3641 XSETINT (delta, new_size - old_size);
3642 /* Try a "normal" resize first. */ 3642 /* Try a "normal" resize first. */
3643 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil); 3643 resize_root_window (root, delta, horflag ? Qt : Qnil, Qnil);
3644 if (resize_window_check (r, horflag) && new_size == XINT (r->new_total)) 3644 if (window_resize_check (r, horflag) && new_size == XINT (r->new_total))
3645 resize_window_apply (r, horflag); 3645 window_resize_apply (r, horflag);
3646 else 3646 else
3647 { 3647 {
3648 /* Try with "reasonable" minimum sizes next. */ 3648 /* Try with "reasonable" minimum sizes next. */
3649 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt); 3649 resize_root_window (root, delta, horflag ? Qt : Qnil, Qt);
3650 if (resize_window_check (r, horflag) 3650 if (window_resize_check (r, horflag)
3651 && new_size == XINT (r->new_total)) 3651 && new_size == XINT (r->new_total))
3652 resize_window_apply (r, horflag); 3652 window_resize_apply (r, horflag);
3653 else 3653 else
3654 { 3654 {
3655 /* Finally, try with "safe" minimum sizes. */ 3655 /* Finally, try with "safe" minimum sizes. */
3656 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe); 3656 resize_root_window (root, delta, horflag ? Qt : Qnil, Qsafe);
3657 if (resize_window_check (r, horflag) 3657 if (window_resize_check (r, horflag)
3658 && new_size == XINT (r->new_total)) 3658 && new_size == XINT (r->new_total))
3659 resize_window_apply (r, horflag); 3659 window_resize_apply (r, horflag);
3660 else 3660 else
3661 { 3661 {
3662 /* We lost. Delete all windows but the frame's 3662 /* We lost. Delete all windows but the frame's
@@ -3765,7 +3765,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3765 XSETINT (p->new_total, 3765 XSETINT (p->new_total,
3766 XINT (horflag ? p->total_cols : p->total_lines) 3766 XINT (horflag ? p->total_cols : p->total_lines)
3767 - XINT (total_size)); 3767 - XINT (total_size));
3768 if (!resize_window_check (p, horflag)) 3768 if (!window_resize_check (p, horflag))
3769 error ("Window sizes don't fit"); 3769 error ("Window sizes don't fit");
3770 else 3770 else
3771 /* Undo the temporary pretension. */ 3771 /* Undo the temporary pretension. */
@@ -3773,7 +3773,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3773 } 3773 }
3774 else 3774 else
3775 { 3775 {
3776 if (!resize_window_check (o, horflag)) 3776 if (!window_resize_check (o, horflag))
3777 error ("Resizing old window failed"); 3777 error ("Resizing old window failed");
3778 else if (XINT (total_size) + XINT (o->new_total) 3778 else if (XINT (total_size) + XINT (o->new_total)
3779 != XINT (horflag ? o->total_cols : o->total_lines)) 3779 != XINT (horflag ? o->total_cols : o->total_lines))
@@ -3861,13 +3861,13 @@ set correctly. See the code of `split-window' for how this is done. */)
3861 n->total_cols = o->total_cols; 3861 n->total_cols = o->total_cols;
3862 } 3862 }
3863 3863
3864 /* Iso-coordinates and sizes are assigned by resize_window_apply, 3864 /* Iso-coordinates and sizes are assigned by window_resize_apply,
3865 get them ready here. */ 3865 get them ready here. */
3866 n->new_total = total_size; 3866 n->new_total = total_size;
3867 n->new_normal = normal_size; 3867 n->new_normal = normal_size;
3868 3868
3869 BLOCK_INPUT; 3869 BLOCK_INPUT;
3870 resize_window_apply (p, horflag); 3870 window_resize_apply (p, horflag);
3871 adjust_glyphs (f); 3871 adjust_glyphs (f);
3872 /* Set buffer of NEW to buffer of reference window. Don't run 3872 /* Set buffer of NEW to buffer of reference window. Don't run
3873 any hooks. */ 3873 any hooks. */
@@ -3945,13 +3945,13 @@ when WINDOW is the only window on its frame. */)
3945 XWINDOW (s->next)->prev = sibling; 3945 XWINDOW (s->next)->prev = sibling;
3946 } 3946 }
3947 3947
3948 if (resize_window_check (r, horflag) 3948 if (window_resize_check (r, horflag)
3949 && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) 3949 && EQ (r->new_total, (horflag ? r->total_cols : r->total_lines)))
3950 /* We can delete WINDOW now. */ 3950 /* We can delete WINDOW now. */
3951 { 3951 {
3952 /* Block input. */ 3952 /* Block input. */
3953 BLOCK_INPUT; 3953 BLOCK_INPUT;
3954 resize_window_apply (p, horflag); 3954 window_resize_apply (p, horflag);
3955 3955
3956 windows_or_buffers_changed++; 3956 windows_or_buffers_changed++;
3957 Vwindow_list = Qnil; 3957 Vwindow_list = Qnil;
@@ -4074,10 +4074,10 @@ grow_mini_window (struct window *w, int delta)
4074 root = FRAME_ROOT_WINDOW (f); 4074 root = FRAME_ROOT_WINDOW (f);
4075 r = XWINDOW (root); 4075 r = XWINDOW (root);
4076 value = call2 (Qresize_root_window_vertically, root, make_number (- delta)); 4076 value = call2 (Qresize_root_window_vertically, root, make_number (- delta));
4077 if (INTEGERP (value) && resize_window_check (r, 0)) 4077 if (INTEGERP (value) && window_resize_check (r, 0))
4078 { 4078 {
4079 BLOCK_INPUT; 4079 BLOCK_INPUT;
4080 resize_window_apply (r, 0); 4080 window_resize_apply (r, 0);
4081 4081
4082 /* Grow the mini-window. */ 4082 /* Grow the mini-window. */
4083 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); 4083 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines));
@@ -4109,10 +4109,10 @@ shrink_mini_window (struct window *w)
4109 r = XWINDOW (root); 4109 r = XWINDOW (root);
4110 value = call2 (Qresize_root_window_vertically, 4110 value = call2 (Qresize_root_window_vertically,
4111 root, make_number (size - 1)); 4111 root, make_number (size - 1));
4112 if (INTEGERP (value) && resize_window_check (r, 0)) 4112 if (INTEGERP (value) && window_resize_check (r, 0))
4113 { 4113 {
4114 BLOCK_INPUT; 4114 BLOCK_INPUT;
4115 resize_window_apply (r, 0); 4115 window_resize_apply (r, 0);
4116 4116
4117 /* Shrink the mini-window. */ 4117 /* Shrink the mini-window. */
4118 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); 4118 XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines));
@@ -4150,12 +4150,12 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4150 4150
4151 r = XWINDOW (FRAME_ROOT_WINDOW (f)); 4151 r = XWINDOW (FRAME_ROOT_WINDOW (f));
4152 height = XINT (r->total_lines) + XINT (w->total_lines); 4152 height = XINT (r->total_lines) + XINT (w->total_lines);
4153 if (resize_window_check (r, 0) 4153 if (window_resize_check (r, 0)
4154 && XINT (w->new_total) > 0 4154 && XINT (w->new_total) > 0
4155 && height == XINT (r->new_total) + XINT (w->new_total)) 4155 && height == XINT (r->new_total) + XINT (w->new_total))
4156 { 4156 {
4157 BLOCK_INPUT; 4157 BLOCK_INPUT;
4158 resize_window_apply (r, 0); 4158 window_resize_apply (r, 0);
4159 4159
4160 w->total_lines = w->new_total; 4160 w->total_lines = w->new_total;
4161 XSETFASTINT (w->top_line, XINT (r->top_line) + XINT (r->total_lines)); 4161 XSETFASTINT (w->top_line, XINT (r->top_line) + XINT (r->total_lines));
@@ -6615,7 +6615,7 @@ function `window-nest' and altered by the function `set-window-nest'. */);
6615 defsubr (&Swindow_new_normal); 6615 defsubr (&Swindow_new_normal);
6616 defsubr (&Sset_window_new_total); 6616 defsubr (&Sset_window_new_total);
6617 defsubr (&Sset_window_new_normal); 6617 defsubr (&Sset_window_new_normal);
6618 defsubr (&Sresize_window_apply); 6618 defsubr (&Swindow_resize_apply);
6619 defsubr (&Swindow_body_size); 6619 defsubr (&Swindow_body_size);
6620 defsubr (&Swindow_hscroll); 6620 defsubr (&Swindow_hscroll);
6621 defsubr (&Sset_window_hscroll); 6621 defsubr (&Sset_window_hscroll);