diff src/term.c @ 83173:6b4b299e2cd5

Fix suspend-frame on the controlling tty (reported by Dan Nicolaescu). * src/term.c (Fdisplay_controlling_tty_p): New function. * src/term.c (syms_of_term): Initialize Sdisplay_controlling_tty_p. * lisp/frame.el (suspend-frame): Use display-controlling-tty-p to decide between suspend-emacs and suspend-tty. * src/keyboard.c (Fsuspend_emacs): Give a better error message when there are multiple open tty devices. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-213
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 10 Jul 2004 21:21:04 +0000
parents 856533c4b08f
children 549734260e34
line wrap: on
line diff
--- a/src/term.c	Sat Jul 10 20:56:57 2004 +0000
+++ b/src/term.c	Sat Jul 10 21:21:04 2004 +0000
@@ -2197,7 +2197,6 @@
     return Qnil;
 }
 
-
 DEFUN ("display-tty-type", Fdisplay_tty_type, Sdisplay_tty_type, 0, 1, 0,
        doc: /* Return the type of the TTY device that DISPLAY uses. */)
   (display)
@@ -2216,6 +2215,22 @@
     return Qnil;
 }
 
+DEFUN ("display-controlling-tty-p", Fdisplay_controlling_tty_p, Sdisplay_controlling_tty_p, 0, 1, 0,
+       doc: /* Return non-nil if DISPLAY is on the controlling tty of the Emacs process. */)
+  (display)
+     Lisp_Object display;
+{
+  struct display *d = get_display (display);
+
+  if (!d)
+    wrong_type_argument (Qdisplay_live_p, display);
+
+  if (d->type != output_termcap || d->display_info.tty->name)
+    return Qnil;
+  else
+    return Qt;
+}
+
 
 /***********************************************************************
 			    Initialization
@@ -3363,6 +3378,7 @@
   defsubr (&Stty_display_color_cells);
   defsubr (&Sdisplay_name);
   defsubr (&Sdisplay_tty_type);
+  defsubr (&Sdisplay_controlling_tty_p);
   defsubr (&Sdelete_display);
   defsubr (&Sdisplay_live_p);
   defsubr (&Sdisplay_list);