mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-08 12:40:49 -08:00
* window.c (window_loop, size_window):
(run_window_configuration_change_hook, enlarge_window): Rename locals to avoid shadowing.
This commit is contained in:
parent
281585b0bd
commit
4554d21363
2 changed files with 26 additions and 23 deletions
|
|
@ -19,6 +19,8 @@
|
|||
* lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
|
||||
|
||||
* xdisp.c (redisplay_window): Rename local to avoid shadowing.
|
||||
* window.c (window_loop, size_window):
|
||||
(run_window_configuration_change_hook, enlarge_window): Likewise.
|
||||
|
||||
2011-03-06 Chong Yidong <cyd@stupidchicken.com>
|
||||
|
||||
|
|
|
|||
47
src/window.c
47
src/window.c
|
|
@ -2209,13 +2209,13 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
|
|||
case DELETE_BUFFER_WINDOWS:
|
||||
if (EQ (w->buffer, obj))
|
||||
{
|
||||
struct frame *f = XFRAME (WINDOW_FRAME (w));
|
||||
struct frame *fr = XFRAME (WINDOW_FRAME (w));
|
||||
|
||||
/* If this window is dedicated, and in a frame of its own,
|
||||
kill the frame. */
|
||||
if (EQ (window, FRAME_ROOT_WINDOW (f))
|
||||
if (EQ (window, FRAME_ROOT_WINDOW (fr))
|
||||
&& !NILP (w->dedicated)
|
||||
&& other_visible_frames (f))
|
||||
&& other_visible_frames (fr))
|
||||
{
|
||||
/* Skip the other windows on this frame.
|
||||
There might be one, the minibuffer! */
|
||||
|
|
@ -2267,16 +2267,16 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
|
|||
if (EQ (w->buffer, obj))
|
||||
{
|
||||
Lisp_Object buffer;
|
||||
struct frame *f = XFRAME (w->frame);
|
||||
struct frame *fr = XFRAME (w->frame);
|
||||
|
||||
/* Find another buffer to show in this window. */
|
||||
buffer = Fother_buffer (obj, Qnil, w->frame);
|
||||
|
||||
/* If this window is dedicated, and in a frame of its own,
|
||||
kill the frame. */
|
||||
if (EQ (window, FRAME_ROOT_WINDOW (f))
|
||||
if (EQ (window, FRAME_ROOT_WINDOW (fr))
|
||||
&& !NILP (w->dedicated)
|
||||
&& other_visible_frames (f))
|
||||
&& other_visible_frames (fr))
|
||||
{
|
||||
/* Skip the other windows on this frame.
|
||||
There might be one, the minibuffer! */
|
||||
|
|
@ -2290,11 +2290,11 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
|
|||
}
|
||||
else if (!NILP (w->dedicated) && !NILP (w->parent))
|
||||
{
|
||||
Lisp_Object window;
|
||||
XSETWINDOW (window, w);
|
||||
Lisp_Object window_to_delete;
|
||||
XSETWINDOW (window_to_delete, w);
|
||||
/* If this window is dedicated and not the only window
|
||||
in its frame, then kill it. */
|
||||
Fdelete_window (window);
|
||||
Fdelete_window (window_to_delete);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -3170,11 +3170,11 @@ size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int firs
|
|||
last_pos = first_pos;
|
||||
for (n = 0, child = *forward; !NILP (child); child = c->next, ++n)
|
||||
{
|
||||
int new_size, old_size;
|
||||
int new_child_size, old_child_size;
|
||||
|
||||
c = XWINDOW (child);
|
||||
old_size = WINDOW_TOTAL_SIZE (c, width_p);
|
||||
new_size = old_size;
|
||||
old_child_size = WINDOW_TOTAL_SIZE (c, width_p);
|
||||
new_child_size = old_child_size;
|
||||
|
||||
/* The top or left edge position of this child equals the
|
||||
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
|
|||
/* If this child can be resized, do it. */
|
||||
if (resize_fixed_p || !window_fixed_size_p (c, width_p, 0))
|
||||
{
|
||||
new_size = new_sizes ? new_sizes[n] : old_size + each + extra;
|
||||
new_child_size =
|
||||
new_sizes ? new_sizes[n] : old_child_size + each + extra;
|
||||
extra = 0;
|
||||
}
|
||||
|
||||
/* Set new size. Note that size_window also propagates
|
||||
edge positions to children, so it's not a no-op if we
|
||||
didn't change the child's size. */
|
||||
size_window (child, new_size, width_p, 1, first_only, last_only);
|
||||
size_window (child, new_child_size, width_p, 1,
|
||||
first_only, last_only);
|
||||
|
||||
/* Remember the bottom/right edge position of this child; it
|
||||
will be used to set the top/left edge of the next child. */
|
||||
last_pos += new_size;
|
||||
last_pos += new_child_size;
|
||||
}
|
||||
|
||||
xfree (new_sizes);
|
||||
|
|
@ -3325,12 +3327,12 @@ run_window_configuration_change_hook (struct frame *f)
|
|||
if (!NILP (Flocal_variable_p (Qwindow_configuration_change_hook,
|
||||
buffer)))
|
||||
{
|
||||
int count = SPECPDL_INDEX ();
|
||||
int count1 = SPECPDL_INDEX ();
|
||||
record_unwind_protect (select_window_norecord, Fselected_window ());
|
||||
select_window_norecord (window);
|
||||
run_funs (Fbuffer_local_value (Qwindow_configuration_change_hook,
|
||||
buffer));
|
||||
unbind_to (count, Qnil);
|
||||
unbind_to (count1, Qnil);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4119,7 +4121,7 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
|
|||
{
|
||||
/* If trying to grow this window to or beyond size of the parent,
|
||||
just delete all the sibling windows. */
|
||||
Lisp_Object start, tem, next;
|
||||
Lisp_Object start, tem;
|
||||
|
||||
start = XWINDOW (parent)->vchild;
|
||||
if (NILP (start))
|
||||
|
|
@ -4129,9 +4131,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
|
|||
tem = XWINDOW (window)->next;
|
||||
while (! NILP (tem))
|
||||
{
|
||||
next = XWINDOW (tem)->next;
|
||||
Lisp_Object next1 = XWINDOW (tem)->next;
|
||||
delete_window (tem);
|
||||
tem = next;
|
||||
tem = next1;
|
||||
}
|
||||
|
||||
/* Delete any siblings that come after WINDOW.
|
||||
|
|
@ -4140,9 +4142,9 @@ enlarge_window (Lisp_Object window, int delta, int horiz_flag)
|
|||
tem = start;
|
||||
while (! EQ (tem, window))
|
||||
{
|
||||
next = XWINDOW (tem)->next;
|
||||
Lisp_Object next1 = XWINDOW (tem)->next;
|
||||
delete_window (tem);
|
||||
tem = next;
|
||||
tem = next1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -7224,4 +7226,3 @@ keys_of_window (void)
|
|||
initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
|
||||
initial_define_key (meta_map, 'v', "scroll-down-command");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue