clear_current_matrices (f);
update_end (f);
if (FRAME_TERMCAP_P (f))
- fflush (TTY_OUTPUT (FRAME_TTY (f)));
+ fflush (FRAME_TTY (f)->output);
windows_or_buffers_changed++;
/* Mark all windows as inaccurate, so that every window will have
its redisplay done. */
update_end (f);
updated_row = NULL;
if (FRAME_TERMCAP_P (f))
- fflush (TTY_OUTPUT (FRAME_TTY (f)));
+ fflush (FRAME_TTY (f)->output);
TRACE ((stderr, "direct output for insert\n"));
mark_window_display_accurate (it.window, 1);
}
if (FRAME_TERMCAP_P (f))
- fflush (TTY_OUTPUT (FRAME_TTY (f)));
+ fflush (FRAME_TTY (f)->output);
redisplay_performed_directly_p = 1;
return 1;
}
if (FRAME_TERMCAP_P (f))
{
- if (TTY_TERMSCRIPT (FRAME_TTY (f)))
- fflush (TTY_TERMSCRIPT (FRAME_TTY (f)));
- fflush (TTY_OUTPUT (FRAME_TTY (f)));
+ if (FRAME_TTY (f)->termscript)
+ fflush (FRAME_TTY (f)->termscript);
+ fflush (FRAME_TTY (f)->output);
}
/* Check window matrices for lost pointers. */
Also flush out if likely to have more than 1k buffered
otherwise. I'm told that some telnet connections get
really screwed by more than 1k output at once. */
- int outq = PENDING_OUTPUT_COUNT (TTY_OUTPUT (FRAME_TTY (f)));
+ int outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f)->output);
if (outq > 900
|| (outq > 20 && ((i - 1) % preempt_count == 0)))
{
- fflush (TTY_OUTPUT (FRAME_TTY (f)));
+ fflush (FRAME_TTY (f)->output);
if (preempt_count == 1)
{
#ifdef EMACS_OUTQSIZE
if (EMACS_OUTQSIZE (0, &outq) < 0)
/* Probably not a tty. Ignore the error and reset
the outq count. */
- outq = PENDING_OUTPUT_COUNT (TTY_OUTPUT (FRAME_TTY (f)));
+ outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f->output));
#endif
outq *= 10;
if (baud_rate <= outq && baud_rate > 0)
if (! tty->term_initted)
continue;
- get_tty_size (fileno (TTY_INPUT (tty)), &width, &height);
+ get_tty_size (fileno (tty->input), &width, &height);
{
Lisp_Object tail, frame;
(file)
Lisp_Object file;
{
- if (TTY_TERMSCRIPT (CURTTY ()) != 0)
- fclose (TTY_TERMSCRIPT (CURTTY ()));
- TTY_TERMSCRIPT (CURTTY ()) = 0;
+ struct tty_display_info *tty;
+
+ if (! FRAME_TERMCAP_P (SELECTED_FRAME ()))
+ error ("Current frame is not on a tty device");
+
+ tty = CURTTY ();
+
+ if (tty->termscript != 0)
+ fclose (tty->termscript);
+ tty->termscript = 0;
if (! NILP (file))
{
file = Fexpand_file_name (file, Qnil);
- TTY_TERMSCRIPT (CURTTY ()) = fopen (SDATA (file), "w");
- if (TTY_TERMSCRIPT (CURTTY ()) == 0)
+ tty->termscript = fopen (SDATA (file), "w");
+ if (tty->termscript == 0)
report_file_error ("Opening termscript", Fcons (file, Qnil));
}
return Qnil;
(string)
Lisp_Object string;
{
+ struct tty_display_info *tty;
+
/* ??? Perhaps we should do something special for multibyte strings here. */
CHECK_STRING (string);
+
if (! FRAME_TERMCAP_P (SELECTED_FRAME ()))
error ("Current frame is not on a tty device");
+
+ tty = CURTTY ();
- if (TTY_TERMSCRIPT (CURTTY ()))
+ if (tty->termscript)
{
- fwrite (SDATA (string), 1, SBYTES (string),
- TTY_TERMSCRIPT (CURTTY ()));
- fflush (TTY_TERMSCRIPT (CURTTY ()));
+ fwrite (SDATA (string), 1, SBYTES (string), tty->termscript);
+ fflush (tty->termscript);
}
- fwrite (SDATA (string), 1, SBYTES (string),
- TTY_OUTPUT (CURTTY ()));
- fflush (TTY_OUTPUT (CURTTY ()));
+ fwrite (SDATA (string), 1, SBYTES (string), tty->output);
+ fflush (tty->output);
return Qnil;
}
else
ring_bell ();
if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
- fflush (TTY_OUTPUT (CURTTY ()));
+ fflush (CURTTY ()->output);
}
else
bitch_at_user ();
else
ring_bell ();
if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
- fflush (TTY_OUTPUT (CURTTY ()));
+ fflush (CURTTY ()->output);
}