diff src/termhooks.h @ 83021:32bf8e7cc0c2

Fixed tty faces during combo sessions. Plus other assorted bugfixes. lisp/startup.el (command-line): Always call tty-register-default-colors. src/dispextern.h (delete_tty): Added missing prototype. src/keyboard.c (read_avail_input): Close display gracefully if needed. Kill Emacs if the last display is to be closed. (tty_read_avail_input): Don't call delete_tty and don't signal hangup here; return -2 instead to indicate the non-transient failure to read_avail_input. src/term.c (delete_tty): Removed superflous wiping of the deleted frames' output_data field. (delete_display): Check for and close live frames that are still on the display. src/termhooks.h (read_socket_hook, delete_display_hook): Added detailed comment. src/xfaces.c (realize_face): Create a dummy face for the initial frame. (Reported by Robert J. Chassell (bob at rattlenake dot com).) git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-61
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 23 Jan 2004 21:48:58 +0000
parents c4d4cbf86260
children bd36a0907b8d
line wrap: on
line diff
--- a/src/termhooks.h	Thu Jan 22 19:39:51 2004 +0000
+++ b/src/termhooks.h	Fri Jan 23 21:48:58 2004 +0000
@@ -472,8 +472,27 @@
   void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
 
 
-  /* Called to read input events.  */
-  int (*read_socket_hook) P_ ((struct display *, struct input_event *, int, int));
+  /* Called to read input events.
+
+     DISPLAY indicates which display to read from.  Input events
+     should be read into BUF, the size of which is given in SIZE.
+     EXPECTED is non-zero if the caller suspects that new input is
+     available.
+
+     A positive return value indicates that that many input events
+     where read into BUF.
+     Zero means no events were immediately available.
+     A value of -1 means a transient read error, while -2 indicates
+     that the display was closed (hangup), and it should be deleted.
+
+     XXX Please note that a non-zero value of EXPECTED only means that
+     there is available input on at least one of the currently opened
+     display devices -- but not necessarily on this device.
+     Therefore, in most cases EXPECTED should be simply ignored.
+  */
+  int (*read_socket_hook) P_ ((struct display *display,
+                               struct input_event *buf,
+                               int size, int expected));
 
   /* Called when a frame's display becomes entirely up to date.  */
   void (*frame_up_to_date_hook) P_ ((struct frame *));
@@ -483,11 +502,16 @@
      on this display. */
   void (*delete_frame_hook) P_ ((struct frame *));
 
-  /* Called after the last frame on this display is deleted.
-     If this is NULL, then the generic delete_frame() is called.
+  /* Called after the last frame on this display is deleted, or when
+     the display device was closed (hangup).
+     
+     If this is NULL, then the generic delete_frame() is called
+     instead.
 
-     Fdelete_frame ensures that there are no live frames on the
-     display when it calls this hook. */
+     The hook must check for and close any live frames that are still
+     on the display.  Fdelete_frame ensures that there are no live
+     frames on the display when it calls this hook, so infinite
+     recursion is prevented.  */
   void (*delete_display_hook) P_ ((struct display *));
 
 };