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,19 +165,46 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0, ...@@ -165,19 +165,46 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
return Qnil; return Qnil;
} }
redraw_frame (f)
FRAME_PTR f;
{
Lisp_Object frame;
XSET (frame, Lisp_Frame, f);
Fredraw_frame (frame);
}
#else
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 ();
clear_frame ();
update_end (0);
fflush (stdout);
clear_frame_records (0);
windows_or_buffers_changed++;
/* Mark all windows as INaccurate,
so that every window will have its redisplay done. */
mark_window_display_accurate (FRAME_ROOT_WINDOW (0), 0);
return Qnil;
}
#endif
DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
"Clear and redisplay all visible frames.") "Clear and redisplay all visible frames.")
() ()
{ {
Lisp_Object frame, tail; Lisp_Object tail, frame;
for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
{
frame = XCONS (tail)->car;
FOR_EACH_FRAME (tail, frame)
/* If we simply redrew all visible frames, whether or not they /* If we simply redrew all visible frames, whether or not they
were garbaged, then this would make all frames clear and were garbaged, then this would make all frames clear and
redraw whenever a new frame is created or an existing frame nredraw whenever a new frame is created or an existing frame
is de-iconified; those events set the global frame_garbaged is de-iconified; those events set the global frame_garbaged
flag, to which redisplay responds by calling this function. flag, to which redisplay responds by calling this function.
...@@ -191,38 +218,10 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", ...@@ -191,38 +218,10 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
if (FRAME_VISIBLE_P (XFRAME (frame)) if (FRAME_VISIBLE_P (XFRAME (frame))
&& FRAME_GARBAGED_P (XFRAME (frame))) && FRAME_GARBAGED_P (XFRAME (frame)))
Fredraw_frame (frame); Fredraw_frame (frame);
}
return Qnil;
}
redraw_frame (f)
FRAME_PTR f;
{
Lisp_Object frame;
XSET (frame, Lisp_Frame, f);
Fredraw_frame (frame);
}
#else /* not MULTI_FRAME */
DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
"Clear screen and output again what is supposed to appear on it.")
()
{
update_begin (0);
set_terminal_modes ();
clear_frame ();
update_end (0);
fflush (stdout);
clear_frame_records (0);
windows_or_buffers_changed++;
/* Mark all windows as INaccurate,
so that every window will have its redisplay done. */
mark_window_display_accurate (FRAME_ROOT_WINDOW (0), 0);
return Qnil; return Qnil;
} }
#endif /* not MULTI_FRAME */
static struct frame_glyphs * static struct frame_glyphs *
make_frame_glyphs (frame, empty) make_frame_glyphs (frame, empty)
...@@ -1605,14 +1604,13 @@ window_change_signal () ...@@ -1605,14 +1604,13 @@ window_change_signal ()
later outside of the signal handler. */ later outside of the signal handler. */
{ {
Lisp_Object tail; Lisp_Object tail, frame;
FRAME_PTR f;
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; break;
} }
} }
...@@ -1631,13 +1629,14 @@ do_pending_window_change () ...@@ -1631,13 +1629,14 @@ do_pending_window_change ()
/* If window_change_signal should have run before, run it now. */ /* If window_change_signal should have run before, run it now. */
while (delayed_size_change) while (delayed_size_change)
{ {
Lisp_Object tail; Lisp_Object tail, frame;
FRAME_PTR f;
delayed_size_change = 0; 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 height = FRAME_NEW_HEIGHT (f);
int width = FRAME_NEW_WIDTH (f); int width = FRAME_NEW_WIDTH (f);
......
...@@ -317,9 +317,9 @@ typedef struct frame *FRAME_PTR; ...@@ -317,9 +317,9 @@ typedef struct frame *FRAME_PTR;
/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
`for' loop which iterates over the elements of Vframe_list. The `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 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. Vframe_list.
If MULTI_FRAME isn't defined, then this loop expands to something which If MULTI_FRAME isn't defined, then this loop expands to something which
...@@ -327,7 +327,7 @@ typedef struct frame *FRAME_PTR; ...@@ -327,7 +327,7 @@ typedef struct frame *FRAME_PTR;
#define FOR_EACH_FRAME(list_var, frame_var) \ #define FOR_EACH_FRAME(list_var, frame_var) \
for ((list_var) = Vframe_list; \ for ((list_var) = Vframe_list; \
(CONSP (list_var) \ (CONSP (list_var) \
&& (frame_var = XFRAME (XCONS (list_var)->car), 1)); \ && (frame_var = XCONS (list_var)->car, 1)); \
list_var = XCONS (list_var)->cdr) list_var = XCONS (list_var)->cdr)
...@@ -412,16 +412,16 @@ extern int last_nonminibuf_frame; ...@@ -412,16 +412,16 @@ extern int last_nonminibuf_frame;
/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
`for' loop which iterates over the elements of Vframe_list. The `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 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. Vframe_list.
If MULTI_FRAME _is_ defined, then this loop expands to a real If MULTI_FRAME _is_ defined, then this loop expands to a real
`for' loop which traverses Vframe_list using LIST_VAR and `for' loop which traverses Vframe_list using LIST_VAR and
FRAME_VAR. */ FRAME_VAR. */
#define FOR_EACH_FRAME(list_var, 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 */ #endif /* not MULTI_FRAME */
......
...@@ -369,11 +369,10 @@ redisplay () ...@@ -369,11 +369,10 @@ redisplay ()
to know if their frames are visible. to know if their frames are visible.
See the comment in frame.h for FRAME_SAMPLE_VISIBILITY. */ See the comment in frame.h for FRAME_SAMPLE_VISIBILITY. */
{ {
Lisp_Object tail; Lisp_Object tail, frame;
FRAME_PTR f;
FOR_EACH_FRAME (tail, f) FOR_EACH_FRAME (tail, frame)
FRAME_SAMPLE_VISIBILITY (f); FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
} }
/* Notice any pending interrupt request to change frame size. */ /* Notice any pending interrupt request to change frame size. */
...@@ -504,15 +503,16 @@ redisplay () ...@@ -504,15 +503,16 @@ redisplay ()
if (all_windows) if (all_windows)
{ {
Lisp_Object tail; Lisp_Object tail, frame;
FRAME_PTR f;
/* Recompute # windows showing selected buffer. /* Recompute # windows showing selected buffer.
This will be incremented each time such a window is displayed. */ This will be incremented each time such a window is displayed. */
buffer_shared = 0; 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 /* Mark all the scroll bars to be removed; we'll redeem the ones
we want when we redisplay their windows. */ we want when we redisplay their windows. */
if (condemn_scroll_bars_hook) 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