/* Updating of data structures for redisplay.
- Copyright (C) 1985, 1986, 1987, 1988, 1990,
- 1992 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1988, 1990,
+ 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
}
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;
for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
{
frame = XCONS (tail)->car;
- if (FRAME_VISIBLE_P (XFRAME (frame)))
+
+ /* 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;
free_frame_glyphs (frame, FRAME_TEMP_GLYPHS (frame));
if (FRAME_MESSAGE_BUF (frame))
- FRAME_MESSAGE_BUF (frame)
- = (char *) xrealloc (FRAME_MESSAGE_BUF (frame),
- FRAME_WIDTH (frame) + 1);
+ {
+ /* Reallocate the frame's message buffer; remember that
+ echo_area_glyphs may be pointing here. */
+ char *old_message_buf = FRAME_MESSAGE_BUF (frame);
+
+ FRAME_MESSAGE_BUF (frame)
+ = (char *) xrealloc (FRAME_MESSAGE_BUF (frame),
+ FRAME_WIDTH (frame) + 1);
+
+ if (echo_area_glyphs == old_message_buf)
+ echo_area_glyphs = FRAME_MESSAGE_BUF (frame);
+ if (previous_echo_glyphs == old_message_buf)
+ previous_echo_glyphs = FRAME_MESSAGE_BUF (frame);
+ }
else
FRAME_MESSAGE_BUF (frame)
= (char *) xmalloc (FRAME_WIDTH (frame) + 1);
#endif /* COMPILER_REGISTER_BUG */
int vpos = FRAME_CURSOR_Y (frame);
- /* Give up if about to continue line */
- if (hpos - XFASTINT (w->left) + 1 + 1 >= XFASTINT (w->width)
-
+ /* Give up if about to continue line. */
+ if (hpos >= XFASTINT (w->left) + window_internal_width (w) - 1
+
/* Avoid losing if cursor is in invisible text off left margin */
|| (XINT (w->hscroll) && hpos == XFASTINT (w->left))
if ((FRAME_CURSOR_X (frame) == XFASTINT (w->left)
&& (XINT (w->hscroll) || n < 0))
|| (n > 0
- && (FRAME_CURSOR_X (frame) + 1
- >= (XFASTINT (w->left) + XFASTINT (w->width)
- - (XFASTINT (w->width) < FRAME_WIDTH (frame))
- - 1)))
+ && (FRAME_CURSOR_X (frame) + 1 >= window_internal_width (w) - 1))
|| cursor_in_echo_area)
return 0;
/* The actual width of the window is window->width less one for the
DISP_CONTINUE_GLYPH, and less one if it's not the rightmost
window. */
- int window_width = (XFASTINT (window->width) - 1
- - (XFASTINT (window->width) + window_left
- != FRAME_WIDTH (XFRAME (window->frame))));
+ int window_width = window_internal_width (window) - 1;
int startp = marker_position (window->start);
/* Char insertion/deletion cost vector, from term.c */
extern int *char_ins_del_vector;
-#define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_HEIGHT((f))])
+#define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_WIDTH((f))])
static void
update_line (frame, vpos)
return Qt;
#ifdef SIGIO
- gobble_input ();
+ gobble_input (0);
#endif
XSET (read_kbd, Lisp_Int, reading ? -1 : 1);