diff options
| author | Paul Eggert | 2011-03-06 22:58:49 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-03-06 22:58:49 -0800 |
| commit | 4554d213635d99c2461e0fc20441fd0e7f14435d (patch) | |
| tree | 8c2edda7e70269fcdf369911238c2bbdbd9d1493 /src | |
| parent | 281585b0bd2a6063c11cfcc308a560f416c3eee7 (diff) | |
| download | emacs-4554d213635d99c2461e0fc20441fd0e7f14435d.tar.gz emacs-4554d213635d99c2461e0fc20441fd0e7f14435d.zip | |
* window.c (window_loop, size_window):
(run_window_configuration_change_hook, enlarge_window):
Rename locals to avoid shadowing.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 2 | ||||
| -rw-r--r-- | src/window.c | 47 |
2 files changed, 26 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a0f797b0e6f..150f193af0b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -19,6 +19,8 @@ | |||
| 19 | * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c. | 19 | * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c. |
| 20 | 20 | ||
| 21 | * xdisp.c (redisplay_window): Rename local to avoid shadowing. | 21 | * xdisp.c (redisplay_window): Rename local to avoid shadowing. |
| 22 | * window.c (window_loop, size_window): | ||
| 23 | (run_window_configuration_change_hook, enlarge_window): Likewise. | ||
| 22 | 24 | ||
| 23 | 2011-03-06 Chong Yidong <cyd@stupidchicken.com> | 25 | 2011-03-06 Chong Yidong <cyd@stupidchicken.com> |
| 24 | 26 | ||
diff --git a/src/window.c b/src/window.c index 7c55be972b2..2ec51a756d4 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 | { |
| @@ -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 | } |
| @@ -4119,7 +4121,7 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag) | |||
| 4119 | { | 4121 | { |
| 4120 | /* If trying to grow this window to or beyond size of the parent, | 4122 | /* If trying to grow this window to or beyond size of the parent, |
| 4121 | just delete all the sibling windows. */ | 4123 | just delete all the sibling windows. */ |
| 4122 | Lisp_Object start, tem, next; | 4124 | Lisp_Object start, tem; |
| 4123 | 4125 | ||
| 4124 | start = XWINDOW (parent)->vchild; | 4126 | start = XWINDOW (parent)->vchild; |
| 4125 | if (NILP (start)) | 4127 | if (NILP (start)) |
| @@ -4129,9 +4131,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag) | |||
| 4129 | tem = XWINDOW (window)->next; | 4131 | tem = XWINDOW (window)->next; |
| 4130 | while (! NILP (tem)) | 4132 | while (! NILP (tem)) |
| 4131 | { | 4133 | { |
| 4132 | next = XWINDOW (tem)->next; | 4134 | Lisp_Object next1 = XWINDOW (tem)->next; |
| 4133 | delete_window (tem); | 4135 | delete_window (tem); |
| 4134 | tem = next; | 4136 | tem = next1; |
| 4135 | } | 4137 | } |
| 4136 | 4138 | ||
| 4137 | /* Delete any siblings that come after WINDOW. | 4139 | /* Delete any siblings that come after WINDOW. |
| @@ -4140,9 +4142,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag) | |||
| 4140 | tem = start; | 4142 | tem = start; |
| 4141 | while (! EQ (tem, window)) | 4143 | while (! EQ (tem, window)) |
| 4142 | { | 4144 | { |
| 4143 | next = XWINDOW (tem)->next; | 4145 | Lisp_Object next1 = XWINDOW (tem)->next; |
| 4144 | delete_window (tem); | 4146 | delete_window (tem); |
| 4145 | tem = next; | 4147 | tem = next1; |
| 4146 | } | 4148 | } |
| 4147 | } | 4149 | } |
| 4148 | else | 4150 | else |
| @@ -7224,4 +7226,3 @@ keys_of_window (void) | |||
| 7224 | initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); | 7226 | initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); |
| 7225 | initial_define_key (meta_map, 'v', "scroll-down-command"); | 7227 | initial_define_key (meta_map, 'v', "scroll-down-command"); |
| 7226 | } | 7228 | } |
| 7227 | |||