/* Display generation from window structure and buffer text.
- Copyright (C) 1985, 86, 87, 88, 93, 94, 95 Free Software Foundation, Inc.
+ Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 1997
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
if (noninteractive_need_newline)
putc ('\n', stderr);
noninteractive_need_newline = 0;
- fwrite (m, len, 1, stderr);
+ if (m)
+ fwrite (m, len, 1, stderr);
if (cursor_in_echo_area == 0)
fprintf (stderr, "\n");
fflush (stderr);
echo_area_glyphs ? echo_area_glyphs : "",
echo_area_glyphs ? echo_area_glyphs_length : -1,
FRAME_LEFT_SCROLL_BAR_WIDTH (f),
- 0, 0, 0, FRAME_WIDTH (f));
+ 0, 0, 0,
+ FRAME_WIDTH (f) + FRAME_LEFT_SCROLL_BAR_WIDTH (f));
#if 0 /* This just gets in the way. update_frame does the job. */
/* If desired cursor location is on this line, put it at end of text */
i < vpos + XFASTINT (XWINDOW (mini_window)->height); i++)
{
get_display_line (f, i, 0);
- display_string (XWINDOW (mini_window), vpos,
+ /* We don't use FRAME_SCROLL_BAR_WIDTH (f) as the starting
+ hpos, because it is good to clear whatever is behind the
+ scroll bar. This does not affect the scroll bar itself. */
+ display_string (XWINDOW (mini_window), i,
"", 0,
- FRAME_LEFT_SCROLL_BAR_WIDTH (f),
- 0, 0, 0, FRAME_WIDTH (f));
+ 0, 0, 0,
+ 0, FRAME_WIDTH (f) + FRAME_SCROLL_BAR_WIDTH (f));
}
}
}
int all_windows;
register int tlbufpos, tlendpos;
struct position pos;
+ int number_of_frames_redisplayed;
if (noninteractive)
return;
return;
#endif
+ retry:
+
if (! FRAME_WINDOW_P (selected_frame)
&& previous_terminal_frame != selected_frame)
{
Fmarker_position (XBUFFER (w->buffer)->mark))))
this_line_bufpos = -1;
+ /* This is in case we goto update, below. */
+ number_of_frames_redisplayed = 1;
+
tlbufpos = this_line_bufpos;
tlendpos = this_line_endpos;
if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line)
/* Recompute # windows showing selected buffer.
This will be incremented each time such a window is displayed. */
buffer_shared = 0;
+ number_of_frames_redisplayed = 0;
FOR_EACH_FRAME (tail, frame)
{
(*condemn_scroll_bars_hook) (f);
if (FRAME_VISIBLE_P (f))
- redisplay_windows (FRAME_ROOT_WINDOW (f), preserve_echo_area);
+ {
+ redisplay_windows (FRAME_ROOT_WINDOW (f), preserve_echo_area);
+ number_of_frames_redisplayed++;
+ }
/* Any scroll bars which redisplay_windows should have nuked
should now go away. */
redisplay_window (selected_window, 1, preserve_echo_area);
if (!WINDOW_FULL_WIDTH_P (w))
preserve_other_columns (w);
+ number_of_frames_redisplayed = 1;
}
update:
request_sigio ();
start_polling ();
+ /* If something has become visible now which was not before,
+ redisplay again, so that we get them. */
+ if (!pause)
+ {
+ Lisp_Object tail, frame;
+ int new_count = 0;
+
+ FOR_EACH_FRAME (tail, frame)
+ {
+ int this_is_visible = 0;
+ if (XFRAME (frame)->visible)
+ this_is_visible = 1;
+ FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
+ if (XFRAME (frame)->visible)
+ this_is_visible = 1;
+
+ if (this_is_visible)
+ new_count++;
+ }
+
+ if (new_count != number_of_frames_redisplayed)
+ windows_or_buffers_changed++;
+ }
+
/* Change frame size now if a change is pending. */
do_pending_window_change ();
- /* If we just did a pending size change, redisplay again
- for the new size. */
+ /* If we just did a pending size change, or have additional
+ visible frames, redisplay again. */
if (windows_or_buffers_changed && !pause)
- redisplay ();
+ goto retry;
}
/* Redisplay, but leave alone any recent echo area message
next_boundary = pos;
p1prev = p1;
prevpos = pos;
- while (1)
+ while (p1 < endp)
{
if (pos >= pause)
{
XSETFASTINT (XVECTOR (items)->contents[i + 3], hpos);
if (hpos < maxendcol)
- hpos = display_string (XWINDOW (FRAME_ROOT_WINDOW (f)), vpos,
+ hpos = display_string (w, vpos,
XSTRING (string)->data,
XSTRING (string)->size,
hpos, 0, 0, hpos, maxendcol);
register char *buf;
int eol_flag;
{
- register Lisp_Object val = coding_system;
+ Lisp_Object val;
+
+ val = coding_system;
if (NILP (val)) /* Not yet decided. */
{
*buf++ = '-';
- if (eol_flag) *buf++ = eol_mnemonic_undecided;
+ if (eol_flag)
+ *buf++ = eol_mnemonic_undecided;
+ /* Don't mention EOL conversion if it isn't decided. */
}
else
{
+ Lisp_Object eolvalue;
+
+ eolvalue = Fget (coding_system, Qeol_type);
+
while (!NILP (val) && SYMBOLP (val))
- val = Fget (val, Qcoding_system);
+ {
+ val = Fget (val, Qcoding_system);
+ if (NILP (eolvalue))
+ eolvalue = Fget (coding_system, Qeol_type);
+ }
+
*buf++ = XFASTINT (XVECTOR (val)->contents[1]);
if (eol_flag)
{
- val = Fget (coding_system, Qeol_type);
-
- if (NILP (val)) /* Not yet decided. */
- *buf++ = eol_mnemonic_undecided;
- else if (VECTORP (val)) /* Not yet decided. */
- *buf++ = eol_mnemonic_undecided;
- else /* INTEGERP (val) -- 1:LF, 2:CRLF, 3:CR */
- *buf++ = (XFASTINT (val) == 1
- ? eol_mnemonic_unix
- : (XFASTINT (val) == 2
- ? eol_mnemonic_dos : eol_mnemonic_mac));
+ /* The EOL conversion we are using. */
+ int eoltype;
+ /* The EOL conversion that is normal on this system. */
+
+ if (NILP (eolvalue)) /* Not yet decided. */
+ eoltype = eol_mnemonic_undecided;
+ else if (VECTORP (eolvalue)) /* Not yet decided. */
+ eoltype = eol_mnemonic_undecided;
+ else /* INTEGERP (eolvalue) -- 0:LF, 1:CRLF, 2:CR */
+ eoltype = (XFASTINT (eolvalue) == 0
+ ? eol_mnemonic_unix
+ : (XFASTINT (eolvalue) == 1
+ ? eol_mnemonic_dos : eol_mnemonic_mac));
+
+ /* Mention the EOL conversion if it is not the usual one. */
+ *buf++ = eoltype;
}
}
return buf;
/* coding-system (including end-of-line type) */
{
int eol_flag = (c == 'Z');
- char *p;
+ char *p = decode_mode_spec_buf;
- p = decode_mode_spec_coding (b->buffer_file_coding_system,
- decode_mode_spec_buf, eol_flag);
if (FRAME_TERMCAP_P (f))
{
- p = decode_mode_spec_coding (keyboard_coding.symbol, p, eol_flag);
- p = decode_mode_spec_coding (terminal_coding.symbol, p, eol_flag);
+ /* No need to mention EOL here--the terminal never needs
+ to do EOL conversion. */
+ p = decode_mode_spec_coding (keyboard_coding.symbol, p, 0);
+ p = decode_mode_spec_coding (terminal_coding.symbol, p, 0);
}
+ p = decode_mode_spec_coding (b->buffer_file_coding_system,
+ p, eol_flag);
+
+#if 0 /* This proves to be annoying; I think we can do without. -- rms. */
#ifdef subprocesses
obj = Fget_buffer_process (Fcurrent_buffer ());
if (PROCESSP (obj))
p, eol_flag);
}
#endif /* subprocesses */
+#endif /* 0 */
*p = 0;
return decode_mode_spec_buf;
}
if (!noninteractive)
{
FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (root_window)));
- XSETFASTINT (XWINDOW (root_window)->top, 0);
- set_window_height (root_window, FRAME_HEIGHT (f) - 1, 0);
+ XSETFASTINT (XWINDOW (root_window)->top, FRAME_MENU_BAR_LINES (f));
+ set_window_height (root_window,
+ FRAME_HEIGHT (f) - 1 - FRAME_MENU_BAR_LINES (f),
+ 0);
XSETFASTINT (mini_w->top, FRAME_HEIGHT (f) - 1);
set_window_height (minibuf_window, 1, 0);