(print_object): Handle terminals.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 20 Sep 2007 21:24:47 +0000 (21:24 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 20 Sep 2007 21:24:47 +0000 (21:24 +0000)
src/print.c

index cd3d643..a14c041 100644 (file)
@@ -34,6 +34,7 @@ Boston, MA 02110-1301, USA.  */
 #include "termchar.h"
 #include "intervals.h"
 #include "blockinput.h"
+#include "termhooks.h"         /* For struct terminal.  */
 
 Lisp_Object Vstandard_output, Qstandard_output;
 
@@ -1965,6 +1966,19 @@ print_object (obj, printcharfun, escapeflag)
            }
          PRINTCHAR ('>');
        }
+      else if (TERMINALP (obj))
+       {
+         struct terminal *t = XTERMINAL (obj);
+         strout ("#<terminal ", -1, -1, printcharfun, 0);
+         sprintf (buf, "%d", t->id);
+         strout (buf, -1, -1, printcharfun, 0);
+         if (t->name)
+           {
+             strout (" on ", -1, -1, printcharfun, 0);
+             strout (t->name, -1, -1, printcharfun, 0);
+           }
+         PRINTCHAR ('>');
+       }
       else if (HASH_TABLE_P (obj))
        {
          struct Lisp_Hash_Table *h = XHASH_TABLE (obj);