diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/src/window.c b/src/window.c index 9a0955955fa..f35815d757c 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -2209,13 +2209,13 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame | |||
| 2209 | case DELETE_BUFFER_WINDOWS: | 2209 | case DELETE_BUFFER_WINDOWS: |
| 2210 | if (EQ (w->buffer, obj)) | 2210 | if (EQ (w->buffer, obj)) |
| 2211 | { | 2211 | { |
| 2212 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 2212 | struct frame *fr = XFRAME (WINDOW_FRAME (w)); |
| 2213 | 2213 | ||
| 2214 | /* If this window is dedicated, and in a frame of its own, | 2214 | /* If this window is dedicated, and in a frame of its own, |
| 2215 | kill the frame. */ | 2215 | kill the frame. */ |
| 2216 | if (EQ (window, FRAME_ROOT_WINDOW (f)) | 2216 | if (EQ (window, FRAME_ROOT_WINDOW (fr)) |
| 2217 | && !NILP (w->dedicated) | 2217 | && !NILP (w->dedicated) |
| 2218 | && other_visible_frames (f)) | 2218 | && other_visible_frames (fr)) |
| 2219 | { | 2219 | { |
| 2220 | /* Skip the other windows on this frame. | 2220 | /* Skip the other windows on this frame. |
| 2221 | There might be one, the minibuffer! */ | 2221 | There might be one, the minibuffer! */ |
| @@ -2267,16 +2267,16 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame | |||
| 2267 | if (EQ (w->buffer, obj)) | 2267 | if (EQ (w->buffer, obj)) |
| 2268 | { | 2268 | { |
| 2269 | Lisp_Object buffer; | 2269 | Lisp_Object buffer; |
| 2270 | struct frame *f = XFRAME (w->frame); | 2270 | struct frame *fr = XFRAME (w->frame); |
| 2271 | 2271 | ||
| 2272 | /* Find another buffer to show in this window. */ | 2272 | /* Find another buffer to show in this window. */ |
| 2273 | buffer = Fother_buffer (obj, Qnil, w->frame); | 2273 | buffer = Fother_buffer (obj, Qnil, w->frame); |
| 2274 | 2274 | ||
| 2275 | /* If this window is dedicated, and in a frame of its own, | 2275 | /* If this window is dedicated, and in a frame of its own, |
| 2276 | kill the frame. */ | 2276 | kill the frame. */ |
| 2277 | if (EQ (window, FRAME_ROOT_WINDOW (f)) | 2277 | if (EQ (window, FRAME_ROOT_WINDOW (fr)) |
| 2278 | && !NILP (w->dedicated) | 2278 | && !NILP (w->dedicated) |
| 2279 | && other_visible_frames (f)) | 2279 | && other_visible_frames (fr)) |
| 2280 | { | 2280 | { |
| 2281 | /* Skip the other windows on this frame. | 2281 | /* Skip the other windows on this frame. |
| 2282 | There might be one, the minibuffer! */ | 2282 | There might be one, the minibuffer! */ |
| @@ -2290,11 +2290,11 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame | |||
| 2290 | } | 2290 | } |
| 2291 | else if (!NILP (w->dedicated) && !NILP (w->parent)) | 2291 | else if (!NILP (w->dedicated) && !NILP (w->parent)) |
| 2292 | { | 2292 | { |
| 2293 | Lisp_Object window; | 2293 | Lisp_Object window_to_delete; |
| 2294 | XSETWINDOW (window, w); | 2294 | XSETWINDOW (window_to_delete, w); |
| 2295 | /* If this window is dedicated and not the only window | 2295 | /* If this window is dedicated and not the only window |
| 2296 | in its frame, then kill it. */ | 2296 | in its frame, then kill it. */ |
| 2297 | Fdelete_window (window); | 2297 | Fdelete_window (window_to_delete); |
| 2298 | } | 2298 | } |
| 2299 | else | 2299 | else |
| 2300 | { | 2300 | { |
| @@ -3124,7 +3124,7 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs | |||
| 3124 | } | 3124 | } |
| 3125 | else if (!NILP (*forward)) | 3125 | else if (!NILP (*forward)) |
| 3126 | { | 3126 | { |
| 3127 | int fixed_size, each, extra, n; | 3127 | int fixed_size, each IF_LINT (= 0), extra IF_LINT (= 0), n; |
| 3128 | int resize_fixed_p, nfixed; | 3128 | int resize_fixed_p, nfixed; |
| 3129 | int last_pos, first_pos, nchildren, total; | 3129 | int last_pos, first_pos, nchildren, total; |
| 3130 | int *new_sizes = NULL; | 3130 | int *new_sizes = NULL; |
| @@ -3170,11 +3170,11 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs | |||
| 3170 | last_pos = first_pos; | 3170 | last_pos = first_pos; |
| 3171 | for (n = 0, child = *forward; !NILP (child); child = c->next, ++n) | 3171 | for (n = 0, child = *forward; !NILP (child); child = c->next, ++n) |
| 3172 | { | 3172 | { |
| 3173 | int new_size, old_size; | 3173 | int new_child_size, old_child_size; |
| 3174 | 3174 | ||
| 3175 | c = XWINDOW (child); | 3175 | c = XWINDOW (child); |
| 3176 | old_size = WINDOW_TOTAL_SIZE (c, width_p); | 3176 | old_child_size = WINDOW_TOTAL_SIZE (c, width_p); |
| 3177 | new_size = old_size; | 3177 | new_child_size = old_child_size; |
| 3178 | 3178 | ||
| 3179 | /* The top or left edge position of this child equals the | 3179 | /* The top or left edge position of this child equals the |
| 3180 | bottom or right edge of its predecessor. */ | 3180 | bottom or right edge of its predecessor. */ |
| @@ -3186,18 +3186,20 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs | |||
| 3186 | /* If this child can be resized, do it. */ | 3186 | /* If this child can be resized, do it. */ |
| 3187 | if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0)) | 3187 | if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0)) |
| 3188 | { | 3188 | { |
| 3189 | new_size = new_sizes ? new_sizes[n] : old_size + each + extra; | 3189 | new_child_size = |
| 3190 | new_sizes ? new_sizes[n] : old_child_size + each + extra; | ||
| 3190 | extra = 0; | 3191 | extra = 0; |
| 3191 | } | 3192 | } |
| 3192 | 3193 | ||
| 3193 | /* Set new size. Note that size_window also propagates | 3194 | /* Set new size. Note that size_window also propagates |
| 3194 | edge positions to children, so it's not a no-op if we | 3195 | edge positions to children, so it's not a no-op if we |
| 3195 | didn't change the child's size. */ | 3196 | didn't change the child's size. */ |
| 3196 | size_window (child, new_size, width_p, 1, first_only, last_only); | 3197 | size_window (child, new_child_size, width_p, 1, |
| 3198 | first_only, last_only); | ||
| 3197 | 3199 | ||
| 3198 | /* Remember the bottom/right edge position of this child; it | 3200 | /* Remember the bottom/right edge position of this child; it |
| 3199 | will be used to set the top/left edge of the next child. */ | 3201 | will be used to set the top/left edge of the next child. */ |
| 3200 | last_pos += new_size; | 3202 | last_pos += new_child_size; |
| 3201 | } | 3203 | } |
| 3202 | 3204 | ||
| 3203 | xfree (new_sizes); | 3205 | xfree (new_sizes); |
| @@ -3325,12 +3327,12 @@ run_window_configuration_change_hook (struct frame *f) | |||
| 3325 | if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook, | 3327 | if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook, |
| 3326 | buffer))) | 3328 | buffer))) |
| 3327 | { | 3329 | { |
| 3328 | int count = SPECPDL_INDEX (); | 3330 | int count1 = SPECPDL_INDEX (); |
| 3329 | record_unwind_protect (select_window_norecord, Fselected_window ()); | 3331 | record_unwind_protect (select_window_norecord, Fselected_window ()); |
| 3330 | select_window_norecord (window); | 3332 | select_window_norecord (window); |
| 3331 | run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook, | 3333 | run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook, |
| 3332 | buffer)); | 3334 | buffer)); |
| 3333 | unbind_to (count, Qnil); | 3335 | unbind_to (count1, Qnil); |
| 3334 | } | 3336 | } |
| 3335 | } | 3337 | } |
| 3336 | } | 3338 | } |
| @@ -3602,7 +3604,7 @@ select_frame_norecord (Lisp_Object frame) | |||
| 3602 | ? Fselect_frame (frame, Qt) : selected_frame; | 3604 | ? Fselect_frame (frame, Qt) : selected_frame; |
| 3603 | } | 3605 | } |
| 3604 | 3606 | ||
| 3605 | Lisp_Object | 3607 | static Lisp_Object |
| 3606 | display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame) | 3608 | display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame) |
| 3607 | { | 3609 | { |
| 3608 | return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame); | 3610 | return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame); |
| @@ -4128,7 +4130,7 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag) | |||
| 4128 | { | 4130 | { |
| 4129 | /* If trying to grow this window to or beyond size of the parent, | 4131 | /* If trying to grow this window to or beyond size of the parent, |
| 4130 | just delete all the sibling windows. */ | 4132 | just delete all the sibling windows. */ |
| 4131 | Lisp_Object start, tem, next; | 4133 | Lisp_Object start, tem; |
| 4132 | 4134 | ||
| 4133 | start = XWINDOW (parent)->vchild; | 4135 | start = XWINDOW (parent)->vchild; |
| 4134 | if (NILP (start)) | 4136 | if (NILP (start)) |
| @@ -4138,9 +4140,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag) | |||
| 4138 | tem = XWINDOW (window)->next; | 4140 | tem = XWINDOW (window)->next; |
| 4139 | while (! NILP (tem)) | 4141 | while (! NILP (tem)) |
| 4140 | { | 4142 | { |
| 4141 | next = XWINDOW (tem)->next; | 4143 | Lisp_Object next1 = XWINDOW (tem)->next; |
| 4142 | delete_window (tem); | 4144 | delete_window (tem); |
| 4143 | tem = next; | 4145 | tem = next1; |
| 4144 | } | 4146 | } |
| 4145 | 4147 | ||
| 4146 | /* Delete any siblings that come after WINDOW. | 4148 | /* Delete any siblings that come after WINDOW. |
| @@ -4149,9 +4151,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag) | |||
| 4149 | tem = start; | 4151 | tem = start; |
| 4150 | while (! EQ (tem, window)) | 4152 | while (! EQ (tem, window)) |
| 4151 | { | 4153 | { |
| 4152 | next = XWINDOW (tem)->next; | 4154 | Lisp_Object next1 = XWINDOW (tem)->next; |
| 4153 | delete_window (tem); | 4155 | delete_window (tem); |
| 4154 | tem = next; | 4156 | tem = next1; |
| 4155 | } | 4157 | } |
| 4156 | } | 4158 | } |
| 4157 | else | 4159 | else |
| @@ -5529,7 +5531,7 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5529 | struct buffer *obuf = current_buffer; | 5531 | struct buffer *obuf = current_buffer; |
| 5530 | int center_p = 0; | 5532 | int center_p = 0; |
| 5531 | EMACS_INT charpos, bytepos; | 5533 | EMACS_INT charpos, bytepos; |
| 5532 | int iarg; | 5534 | int iarg IF_LINT (= 0); |
| 5533 | int this_scroll_margin; | 5535 | int this_scroll_margin; |
| 5534 | 5536 | ||
| 5535 | /* If redisplay is suppressed due to an error, try again. */ | 5537 | /* If redisplay is suppressed due to an error, try again. */ |
| @@ -7211,4 +7213,3 @@ keys_of_window (void) | |||
| 7211 | initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); | 7213 | initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); |
| 7212 | initial_define_key (meta_map, 'v', "scroll-down-command"); | 7214 | initial_define_key (meta_map, 'v', "scroll-down-command"); |
| 7213 | } | 7215 | } |
| 7214 | |||