aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorJoakim Verona2012-09-28 10:01:27 +0200
committerJoakim Verona2012-09-28 10:01:27 +0200
commit5fcc7035c884b4419a1619551222b5f28ad9906f (patch)
tree8b85fa0b18603b47383794afd2607a2edc97dd99 /src/window.c
parentbe25526e5384268a6a834e701a194626ecc3ca53 (diff)
parent5bc93c6718562a9819b4919b595281bf85689306 (diff)
downloademacs-5fcc7035c884b4419a1619551222b5f28ad9906f.tar.gz
emacs-5fcc7035c884b4419a1619551222b5f28ad9906f.zip
finally builds again
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c97
1 files changed, 55 insertions, 42 deletions
diff --git a/src/window.c b/src/window.c
index abdee7ec19b..21dddb8a931 100644
--- a/src/window.c
+++ b/src/window.c
@@ -61,8 +61,7 @@ static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer;
61static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; 61static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window;
62static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically; 62static Lisp_Object Qwindow_resize_root_window, Qwindow_resize_root_window_vertically;
63static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; 63static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
64static Lisp_Object Qsafe, Qabove, Qbelow; 64static Lisp_Object Qsafe, Qabove, Qbelow, Qtemp_buffer_resize, Qclone_of;
65static Lisp_Object Qclone_of;
66 65
67static int displayed_window_lines (struct window *); 66static int displayed_window_lines (struct window *);
68static int count_windows (struct window *); 67static int count_windows (struct window *);
@@ -614,10 +613,10 @@ WINDOW are never \(re-)combined with WINDOW's siblings. */)
614DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, 613DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0,
615 doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT. 614 doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT.
616WINDOW must be a valid window and defaults to the selected one. 615WINDOW must be a valid window and defaults to the selected one.
617If LIMIT is nil, child windows of WINDOW can be recombined with 616If LIMIT is nil, child windows of WINDOW can be recombined with WINDOW's
618WINDOW's siblings. LIMIT t means that child windows of WINDOW are 617siblings. LIMIT t means that child windows of WINDOW are never
619never \(re-)combined with WINDOW's siblings. Other values are reserved 618\(re-)combined with WINDOW's siblings. Other values are reserved for
620for future use. */) 619future use. */)
621 (Lisp_Object window, Lisp_Object limit) 620 (Lisp_Object window, Lisp_Object limit)
622{ 621{
623 wset_combination_limit (decode_valid_window (window), limit); 622 wset_combination_limit (decode_valid_window (window), limit);
@@ -2821,7 +2820,7 @@ window-start value is reasonable when this function is called. */)
2821 } 2820 }
2822 } 2821 }
2823 2822
2824 BLOCK_INPUT; 2823 block_input ();
2825 if (!FRAME_INITIAL_P (f)) 2824 if (!FRAME_INITIAL_P (f))
2826 { 2825 {
2827 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 2826 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
@@ -2963,7 +2962,7 @@ window-start value is reasonable when this function is called. */)
2963 } 2962 }
2964 2963
2965 adjust_glyphs (f); 2964 adjust_glyphs (f);
2966 UNBLOCK_INPUT; 2965 unblock_input ();
2967 2966
2968 run_window_configuration_change_hook (f); 2967 run_window_configuration_change_hook (f);
2969 2968
@@ -3467,7 +3466,7 @@ make_window (void)
3467 allocate_window. */ 3466 allocate_window. */
3468 wset_prev_buffers (w, Qnil); 3467 wset_prev_buffers (w, Qnil);
3469 wset_next_buffers (w, Qnil); 3468 wset_next_buffers (w, Qnil);
3470 3469
3471 /* Initialize non-Lisp data. Note that allocate_window zeroes out all 3470 /* Initialize non-Lisp data. Note that allocate_window zeroes out all
3472 non-Lisp data, so do it only for slots which should not be zero. */ 3471 non-Lisp data, so do it only for slots which should not be zero. */
3473 w->nrows_scale_factor = w->ncols_scale_factor = 1; 3472 w->nrows_scale_factor = w->ncols_scale_factor = 1;
@@ -3698,14 +3697,14 @@ be applied on the Elisp level. */)
3698 (horflag ? r->total_cols : r->total_lines))) 3697 (horflag ? r->total_cols : r->total_lines)))
3699 return Qnil; 3698 return Qnil;
3700 3699
3701 BLOCK_INPUT; 3700 block_input ();
3702 window_resize_apply (r, horflag); 3701 window_resize_apply (r, horflag);
3703 3702
3704 windows_or_buffers_changed++; 3703 windows_or_buffers_changed++;
3705 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 3704 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
3706 3705
3707 adjust_glyphs (f); 3706 adjust_glyphs (f);
3708 UNBLOCK_INPUT; 3707 unblock_input ();
3709 3708
3710 run_window_configuration_change_hook (f); 3709 run_window_configuration_change_hook (f);
3711 3710
@@ -3849,7 +3848,7 @@ set correctly. See the code of `split-window' for how this is done. */)
3849 We do that if either `window-combination-limit' is t, or OLD has no 3848 We do that if either `window-combination-limit' is t, or OLD has no
3850 parent, or OLD is ortho-combined. */ 3849 parent, or OLD is ortho-combined. */
3851 combination_limit = 3850 combination_limit =
3852 !NILP (Vwindow_combination_limit) 3851 EQ (Vwindow_combination_limit, Qt)
3853 || NILP (o->parent) 3852 || NILP (o->parent)
3854 || NILP (horflag 3853 || NILP (horflag
3855 ? (XWINDOW (o->parent)->hchild) 3854 ? (XWINDOW (o->parent)->hchild)
@@ -3904,9 +3903,9 @@ set correctly. See the code of `split-window' for how this is done. */)
3904 3903
3905 make_parent_window (old, horflag); 3904 make_parent_window (old, horflag);
3906 p = XWINDOW (o->parent); 3905 p = XWINDOW (o->parent);
3907 /* Store value of `window-combination-limit' in new parent's 3906 /* Store t in the new parent's combination_limit slot to avoid
3908 combination_limit slot. */ 3907 that its children get merged into another window. */
3909 wset_combination_limit (p, Vwindow_combination_limit); 3908 wset_combination_limit (p, Qt);
3910 /* These get applied below. */ 3909 /* These get applied below. */
3911 wset_new_total (p, horflag ? o->total_cols : o->total_lines); 3910 wset_new_total (p, horflag ? o->total_cols : o->total_lines);
3912 wset_new_normal (p, new_normal); 3911 wset_new_normal (p, new_normal);
@@ -3975,13 +3974,13 @@ set correctly. See the code of `split-window' for how this is done. */)
3975 wset_new_total (n, total_size); 3974 wset_new_total (n, total_size);
3976 wset_new_normal (n, normal_size); 3975 wset_new_normal (n, normal_size);
3977 3976
3978 BLOCK_INPUT; 3977 block_input ();
3979 window_resize_apply (p, horflag); 3978 window_resize_apply (p, horflag);
3980 adjust_glyphs (f); 3979 adjust_glyphs (f);
3981 /* Set buffer of NEW to buffer of reference window. Don't run 3980 /* Set buffer of NEW to buffer of reference window. Don't run
3982 any hooks. */ 3981 any hooks. */
3983 set_window_buffer (new, r->buffer, 0, 1); 3982 set_window_buffer (new, r->buffer, 0, 1);
3984 UNBLOCK_INPUT; 3983 unblock_input ();
3985 3984
3986 /* Maybe we should run the scroll functions in Elisp (which already 3985 /* Maybe we should run the scroll functions in Elisp (which already
3987 runs the configuration change hook). */ 3986 runs the configuration change hook). */
@@ -4062,7 +4061,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4062 { 4061 {
4063 4062
4064 /* Block input. */ 4063 /* Block input. */
4065 BLOCK_INPUT; 4064 block_input ();
4066#ifdef HAVE_XWIDGETS 4065#ifdef HAVE_XWIDGETS
4067 xwidget_view_delete_all_in_window(w); 4066 xwidget_view_delete_all_in_window(w);
4068#endif 4067#endif
@@ -4137,7 +4136,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4137 else 4136 else
4138 fset_selected_window (f, new_selected_window); 4137 fset_selected_window (f, new_selected_window);
4139 4138
4140 UNBLOCK_INPUT; 4139 unblock_input ();
4141 4140
4142 /* Now look whether `get-mru-window' gets us something. */ 4141 /* Now look whether `get-mru-window' gets us something. */
4143 mru_window = call1 (Qget_mru_window, frame); 4142 mru_window = call1 (Qget_mru_window, frame);
@@ -4152,7 +4151,7 @@ Signal an error when WINDOW is the only window on its frame. */)
4152 fset_selected_window (f, new_selected_window); 4151 fset_selected_window (f, new_selected_window);
4153 } 4152 }
4154 else 4153 else
4155 UNBLOCK_INPUT; 4154 unblock_input ();
4156 4155
4157 /* Must be run by the caller: 4156 /* Must be run by the caller:
4158 run_window_configuration_change_hook (f); */ 4157 run_window_configuration_change_hook (f); */
@@ -4202,7 +4201,7 @@ grow_mini_window (struct window *w, int delta)
4202 root, make_number (- delta)); 4201 root, make_number (- delta));
4203 if (INTEGERP (value) && window_resize_check (r, 0)) 4202 if (INTEGERP (value) && window_resize_check (r, 0))
4204 { 4203 {
4205 BLOCK_INPUT; 4204 block_input ();
4206 window_resize_apply (r, 0); 4205 window_resize_apply (r, 0);
4207 4206
4208 /* Grow the mini-window. */ 4207 /* Grow the mini-window. */
@@ -4214,7 +4213,7 @@ grow_mini_window (struct window *w, int delta)
4214 w->last_overlay_modified = 0; 4213 w->last_overlay_modified = 0;
4215 4214
4216 adjust_glyphs (f); 4215 adjust_glyphs (f);
4217 UNBLOCK_INPUT; 4216 unblock_input ();
4218 } 4217 }
4219} 4218}
4220 4219
@@ -4239,7 +4238,7 @@ shrink_mini_window (struct window *w)
4239 root, make_number (size - 1)); 4238 root, make_number (size - 1));
4240 if (INTEGERP (value) && window_resize_check (r, 0)) 4239 if (INTEGERP (value) && window_resize_check (r, 0))
4241 { 4240 {
4242 BLOCK_INPUT; 4241 block_input ();
4243 window_resize_apply (r, 0); 4242 window_resize_apply (r, 0);
4244 4243
4245 /* Shrink the mini-window. */ 4244 /* Shrink the mini-window. */
@@ -4251,7 +4250,7 @@ shrink_mini_window (struct window *w)
4251 w->last_overlay_modified = 0; 4250 w->last_overlay_modified = 0;
4252 4251
4253 adjust_glyphs (f); 4252 adjust_glyphs (f);
4254 UNBLOCK_INPUT; 4253 unblock_input ();
4255 } 4254 }
4256 /* If the above failed for whatever strange reason we must make a 4255 /* If the above failed for whatever strange reason we must make a
4257 one window frame here. The same routine will be needed when 4256 one window frame here. The same routine will be needed when
@@ -4283,7 +4282,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4283 && XINT (w->new_total) > 0 4282 && XINT (w->new_total) > 0
4284 && height == XINT (r->new_total) + XINT (w->new_total)) 4283 && height == XINT (r->new_total) + XINT (w->new_total))
4285 { 4284 {
4286 BLOCK_INPUT; 4285 block_input ();
4287 window_resize_apply (r, 0); 4286 window_resize_apply (r, 0);
4288 4287
4289 wset_total_lines (w, w->new_total); 4288 wset_total_lines (w, w->new_total);
@@ -4293,7 +4292,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini
4293 windows_or_buffers_changed++; 4292 windows_or_buffers_changed++;
4294 FRAME_WINDOW_SIZES_CHANGED (f) = 1; 4293 FRAME_WINDOW_SIZES_CHANGED (f) = 1;
4295 adjust_glyphs (f); 4294 adjust_glyphs (f);
4296 UNBLOCK_INPUT; 4295 unblock_input ();
4297 4296
4298 run_window_configuration_change_hook (f); 4297 run_window_configuration_change_hook (f);
4299 return Qt; 4298 return Qt;
@@ -5629,7 +5628,7 @@ the return value is nil. Otherwise the value is t. */)
5629 5628
5630 /* The mouse highlighting code could get screwed up 5629 /* The mouse highlighting code could get screwed up
5631 if it runs during this. */ 5630 if it runs during this. */
5632 BLOCK_INPUT; 5631 block_input ();
5633 5632
5634 if (data->frame_lines != previous_frame_lines 5633 if (data->frame_lines != previous_frame_lines
5635 || data->frame_cols != previous_frame_cols) 5634 || data->frame_cols != previous_frame_cols)
@@ -5880,7 +5879,7 @@ the return value is nil. Otherwise the value is t. */)
5880 } 5879 }
5881 5880
5882 adjust_glyphs (f); 5881 adjust_glyphs (f);
5883 UNBLOCK_INPUT; 5882 unblock_input ();
5884 5883
5885 /* Scan dead buffer windows. */ 5884 /* Scan dead buffer windows. */
5886 for (; CONSP (dead_windows); dead_windows = XCDR (dead_windows)) 5885 for (; CONSP (dead_windows); dead_windows = XCDR (dead_windows))
@@ -6709,6 +6708,7 @@ syms_of_window (void)
6709 DEFSYM (Qreplace_buffer_in_windows, "replace-buffer-in-windows"); 6708 DEFSYM (Qreplace_buffer_in_windows, "replace-buffer-in-windows");
6710 DEFSYM (Qrecord_window_buffer, "record-window-buffer"); 6709 DEFSYM (Qrecord_window_buffer, "record-window-buffer");
6711 DEFSYM (Qget_mru_window, "get-mru-window"); 6710 DEFSYM (Qget_mru_window, "get-mru-window");
6711 DEFSYM (Qtemp_buffer_resize, "temp-buffer-resize");
6712 DEFSYM (Qtemp_buffer_show_hook, "temp-buffer-show-hook"); 6712 DEFSYM (Qtemp_buffer_show_hook, "temp-buffer-show-hook");
6713 DEFSYM (Qabove, "above"); 6713 DEFSYM (Qabove, "above");
6714 DEFSYM (Qbelow, "below"); 6714 DEFSYM (Qbelow, "below");
@@ -6804,23 +6804,36 @@ This variable takes no effect if `window-combination-limit' is non-nil. */);
6804 Vwindow_combination_resize = Qnil; 6804 Vwindow_combination_resize = Qnil;
6805 6805
6806 DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit, 6806 DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit,
6807 doc: /* If t, splitting a window makes a new parent window. 6807 doc: /* If non-nil, splitting a window makes a new parent window.
6808If this variable is nil, splitting a window will create a new parent 6808The following values are recognized:
6809window only if the window has no parent window or the window shall
6810become a combination orthogonal to the one it is part of.
6811 6809
6812If this variable is t, splitting a window always creates a new parent 6810nil means splitting a window will create a new parent window only if the
6813window. If all splits behave this way, each frame's window tree is a 6811 window has no parent window or the window shall become a combination
6814binary tree and every window but the frame's root window has exactly one 6812 orthogonal to the one it is part of.
6815sibling.
6816 6813
6817Other values are reserved for future use. 6814`temp-buffer-resize' means that splitting a window for displaying a
6815 temporary buffer makes a new parent window provided
6816 `temp-buffer-resize-mode' is enabled. Otherwise, this value is
6817 handled like nil.
6818
6819`temp-buffer' means that splitting a window for displaying a temporary
6820 buffer always makes a new parent window. Otherwise, this value is
6821 handled like nil.
6822
6823
6824`display-buffer' means that splitting a window for displaying a buffer
6825 always makes a new parent window. Since temporary buffers are
6826 displayed by the function `display-buffer', this value is stronger
6827 than `temp-buffer'. Splitting a window for other purpose makes a
6828 new parent window only if needed.
6829
6830t means that splitting a window always creates a new parent window. If
6831 all splits behave this way, each frame's window tree is a binary
6832 tree and every window but the frame's root window has exactly one
6833 sibling.
6818 6834
6819The value of this variable is also assigned to the combination limit of 6835Other values are reserved for future use. */);
6820the new parent window. The combination limit of a window can be 6836 Vwindow_combination_limit = Qtemp_buffer_resize;
6821retrieved via the function `window-combination-limit' and altered by the
6822function `set-window-combination-limit'. */);
6823 Vwindow_combination_limit = Qnil;
6824 6837
6825 DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters, 6838 DEFVAR_LISP ("window-persistent-parameters", Vwindow_persistent_parameters,
6826 doc: /* Alist of persistent window parameters. 6839 doc: /* Alist of persistent window parameters.