diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-09-03 00:36:11 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2009-09-03 00:36:11 +0000 |
commit | 7cef7ce343169850e48de169cf702a0b87886e6a (patch) | |
tree | a2bff1885bc62a1784feb9a32d62e387de2498b6 /src/dispnew.c | |
parent | a54fa5b720201e4717d0177821b8defcdad3d916 (diff) | |
download | emacs-7cef7ce343169850e48de169cf702a0b87886e6a.tar.gz |
(Fsend_string_to_terminal): Make it work again on the initial terminal as well.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r-- | src/dispnew.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 5236d53c01e..22a876c8d17 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6475,8 +6475,8 @@ currently selected frame. */) Lisp_Object string; Lisp_Object terminal; { - struct terminal *t = get_tty_terminal (terminal, 1); - struct tty_display_info *tty; + struct terminal *t = get_terminal (terminal, 1); + FILE *out; /* ??? Perhaps we should do something special for multibyte strings here. */ CHECK_STRING (string); @@ -6485,18 +6485,26 @@ currently selected frame. */) if (!t) error ("Unknown terminal device"); - tty = t->display_info.tty; + if (t->type == output_initial) + out = stdout; + else if (t->type != output_termcap && t->type != output_msdos_raw) + error ("Device %d is not a termcap terminal device", t->id); + else + { + struct tty_display_info *tty = t->display_info.tty; - if (! tty->output) - error ("Terminal is currently suspended"); + if (! tty->output) + error ("Terminal is currently suspended"); - if (tty->termscript) - { - fwrite (SDATA (string), 1, SBYTES (string), tty->termscript); - fflush (tty->termscript); + if (tty->termscript) + { + fwrite (SDATA (string), 1, SBYTES (string), tty->termscript); + fflush (tty->termscript); + } + out = tty->output; } - fwrite (SDATA (string), 1, SBYTES (string), tty->output); - fflush (tty->output); + fwrite (SDATA (string), 1, SBYTES (string), out); + fflush (out); UNBLOCK_INPUT; return Qnil; } |