Commit 35f56f96 authored by Jim Blandy's avatar Jim Blandy

* frame.h (FOR_EACH_FRAME): Change the definition so that

	FRAME_VAR is a lisp object.
	* dispnew.c (WINDOW_CHANGE_SIGNAL, do_pending_window_change):
	Adjusted appropriately.
	* xdisp.c (redisplay): Adjusted appropriately.

	* dispnew.c (Fredraw_frame): Give this appropriate definitions for
	MULTI_FRAME and non-MULTI_FRAME configurations.
	(Fredraw_display): Give this a non-MULTI_FRAME-dependent definition.
parent 9789a4be
......@@ -165,36 +165,6 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
return Qnil;
}
DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
"Clear and redisplay all visible frames.")
()
{
Lisp_Object frame, tail;
for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
{
frame = XCONS (tail)->car;
/* If we simply redrew all visible frames, whether or not they
were garbaged, then this would make all frames clear and
redraw whenever a new frame is created or an existing frame
is de-iconified; those events set the global frame_garbaged
flag, to which redisplay responds by calling this function.
This used to redraw all visible frames; the only advantage of
that approach is that if a frame changes from invisible to
visible without setting its garbaged flag, it still gets
redisplayed. But that should never happen; since invisible
frames are not updated, they should always be marked as
garbaged when they become visible again. If that doesn't
happen, it's a bug in the visibility code, not a bug here. */
if (FRAME_VISIBLE_P (XFRAME (frame))
&& FRAME_GARBAGED_P (XFRAME (frame)))
Fredraw_frame (frame);
}
return Qnil;
}
redraw_frame (f)
FRAME_PTR f;
{
......@@ -203,11 +173,12 @@ redraw_frame (f)
Fredraw_frame (frame);
}
#else /* not MULTI_FRAME */
#else
DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
"Clear screen and output again what is supposed to appear on it.")
()
DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, "",
"Clear frame FRAME and output again what is supposed to appear on it.")
(frame)
Lisp_Object frame;
{
update_begin (0);
set_terminal_modes ();
......@@ -222,7 +193,35 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
return Qnil;
}
#endif /* not MULTI_FRAME */
#endif
DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
"Clear and redisplay all visible frames.")
()
{
Lisp_Object tail, frame;
FOR_EACH_FRAME (tail, frame)
/* If we simply redrew all visible frames, whether or not they
were garbaged, then this would make all frames clear and
nredraw whenever a new frame is created or an existing frame
is de-iconified; those events set the global frame_garbaged
flag, to which redisplay responds by calling this function.
This used to redraw all visible frames; the only advantage of
that approach is that if a frame changes from invisible to
visible without setting its garbaged flag, it still gets
redisplayed. But that should never happen; since invisible
frames are not updated, they should always be marked as
garbaged when they become visible again. If that doesn't
happen, it's a bug in the visibility code, not a bug here. */
if (FRAME_VISIBLE_P (XFRAME (frame))
&& FRAME_GARBAGED_P (XFRAME (frame)))
Fredraw_frame (frame);
return Qnil;
}
static struct frame_glyphs *
make_frame_glyphs (frame, empty)
......@@ -1605,14 +1604,13 @@ window_change_signal ()
later outside of the signal handler. */
{
Lisp_Object tail;
FRAME_PTR f;
Lisp_Object tail, frame;
FOR_EACH_FRAME (tail, f)
FOR_EACH_FRAME (tail, frame)
{
if (FRAME_TERMCAP_P (f))
if (FRAME_TERMCAP_P (XFRAME (frame)))
{
change_frame_size (f, height, width, 0, 1);
change_frame_size (XFRAME (frame), height, width, 0, 1);
break;
}
}
......@@ -1631,13 +1629,14 @@ do_pending_window_change ()
/* If window_change_signal should have run before, run it now. */
while (delayed_size_change)
{
Lisp_Object tail;
FRAME_PTR f;
Lisp_Object tail, frame;
delayed_size_change = 0;
FOR_EACH_FRAME (tail, f)
FOR_EACH_FRAME (tail, frame)
{
FRAME_PTR f = XFRAME (frame);
int height = FRAME_NEW_HEIGHT (f);
int width = FRAME_NEW_WIDTH (f);
......
......@@ -317,9 +317,9 @@ typedef struct frame *FRAME_PTR;
/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
`for' loop which iterates over the elements of Vframe_list. The
loop will set FRAME_VAR, a FRAME_PTR, to each frame in
loop will set FRAME_VAR, a Lisp_Object, to each frame in
Vframe_list in succession and execute the statement. LIST_VAR
should be a Lisp_Object; it is used to iterate through the
should be a Lisp_Object too; it is used to iterate through the
Vframe_list.
If MULTI_FRAME isn't defined, then this loop expands to something which
......@@ -327,7 +327,7 @@ typedef struct frame *FRAME_PTR;
#define FOR_EACH_FRAME(list_var, frame_var) \
for ((list_var) = Vframe_list; \
(CONSP (list_var) \
&& (frame_var = XFRAME (XCONS (list_var)->car), 1)); \
&& (frame_var = XCONS (list_var)->car, 1)); \
list_var = XCONS (list_var)->cdr)
......@@ -412,16 +412,16 @@ extern int last_nonminibuf_frame;
/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
`for' loop which iterates over the elements of Vframe_list. The
loop will set FRAME_VAR, a FRAME_PTR, to each frame in
loop will set FRAME_VAR, a Lisp_Object, to each frame in
Vframe_list in succession and execute the statement. LIST_VAR
should be a Lisp_Object; it is used to iterate through the
should be a Lisp_Object too; it is used to iterate through the
Vframe_list.
If MULTI_FRAME _is_ defined, then this loop expands to a real
`for' loop which traverses Vframe_list using LIST_VAR and
FRAME_VAR. */
#define FOR_EACH_FRAME(list_var, frame_var) \
for (frame_var = (FRAME_PTR) 1; frame_var; frame_var = (FRAME_PTR) 0)
for (list_var = Qt; frame_var = selected_frame, ! NILP (list_var); list_var = Qnil)
#endif /* not MULTI_FRAME */
......
......@@ -369,11 +369,10 @@ redisplay ()
to know if their frames are visible.
See the comment in frame.h for FRAME_SAMPLE_VISIBILITY. */
{
Lisp_Object tail;
FRAME_PTR f;
Lisp_Object tail, frame;
FOR_EACH_FRAME (tail, f)
FRAME_SAMPLE_VISIBILITY (f);
FOR_EACH_FRAME (tail, frame)
FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
}
/* Notice any pending interrupt request to change frame size. */
......@@ -504,15 +503,16 @@ redisplay ()
if (all_windows)
{
Lisp_Object tail;
FRAME_PTR f;
Lisp_Object tail, frame;
/* Recompute # windows showing selected buffer.
This will be incremented each time such a window is displayed. */
buffer_shared = 0;
FOR_EACH_FRAME (tail, f)
FOR_EACH_FRAME (tail, frame)
{
FRAME_PTR f = XFRAME (frame);
/* Mark all the scroll bars to be removed; we'll redeem the ones
we want when we redisplay their windows. */
if (condemn_scroll_bars_hook)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment