diff src/keyboard.c @ 83009:b2b37c85b00a

Numerous bugfixes and small improvements. lisp/bindings.el (mode-line-frame-identification): Use %T, not %F. lisp/faces.el (x-create-frame-with-faces): Added frame-creation-function parameter. (tty-create-frame-with-faces): Ditto. lisp/frame.el (frame-creation-function): Make it frame-local. (select-frame-set-input-focus): Use the window-system function, not the variable. lisp/server.el (server-handle-delete-tty): Make sure the client process is removed from server-clients after the delete-process call. It seems that the sentinel is not called. Added docs. (server-process-filter): Immediately add the client to server-clients when a new termcap frame is created. Fixed a case of `not' called with two parameters. Ignore errors while sending the evaluation result back to the client. (server-kill-buffer-query-function): Don't ask the user if the server process is already dead. lisp/term/x-win.el: Don't change mode-line-frame-identification. src/buffer.c (syms_of_buffer): Added %T to the docs of mode-line-format. src/dispnew.c (init_display): Increment the reference count of the new termcap display. src/frame.c (make_terminal_frame): Set the old top frame's visibility to `obscured'. (Fmake_terminal_frame): Look at the current termcap display's name, not just the similar frame parameter. Try to get the type from the current display first, and only then from Vdefault_frame_alist. src/keyboard.c (handle_interrupt): New function to separate the signal handling from C-g processing. (interrupt_signal): Call handle_interrupt to do the real work. (kbd_buffer_store_event): Use handle_interrupt instead of interrupt_signal. (cmd_error_internal): Use FRAME_INITIAL_P instead of ugly hacks. src/termhooks.h (initial_display): New declaration. src/xdisp.c (decode_mode_spec): Added '%T' (termcap-only frame name). git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-49
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 10 Jan 2004 12:56:22 +0000
parents 040dd41ed7d0
children 82554ed1aed8
line wrap: on
line diff
--- a/src/keyboard.c	Fri Jan 09 18:57:53 2004 +0000
+++ b/src/keyboard.c	Sat Jan 10 12:56:22 2004 +0000
@@ -692,6 +692,7 @@
 static void clear_event P_ ((struct input_event *));
 static void any_kboard_state P_ ((void));
 static SIGTYPE interrupt_signal P_ ((int signalnum));
+static void handle_interrupt P_ ((void));
 
 /* Nonzero means don't try to suspend even if the operating system seems
    to support it.  */
@@ -1202,10 +1203,7 @@
   if (!sf->glyphs_initialized_p
       /* This is the case of the frame dumped with Emacs, when we're
 	 running under a window system.  */
-      || (!NILP (Vwindow_system)
-	  && !inhibit_window_system
-	  && FRAME_TERMCAP_P (sf)
-          && !FRAME_TTY (sf)->type) /* XXX This is ugly. */
+      || FRAME_INITIAL_P (sf)
       || noninteractive)
     {
       stream = Qexternal_debugging_output;
@@ -3606,7 +3604,7 @@
 	  }
 
 	  last_event_timestamp = event->timestamp;
-	  interrupt_signal (0 /* dummy */);
+	  handle_interrupt ();
 	  return;
 	}
 
@@ -10235,10 +10233,10 @@
 {
   input_available_clear_time = time_to_clear;
 
-  /* Tell interrupt_signal to throw back to read_char,  */
+  /* Tell handle_interrupt to throw back to read_char,  */
   waiting_for_input = 1;
 
-  /* If interrupt_signal was called before and buffered a C-g,
+  /* If handle_interrupt was called before and buffered a C-g,
      make it run again now, to avoid timing error. */
   if (!NILP (Vquit_flag))
     quit_throw_to_read_char ();
@@ -10247,7 +10245,7 @@
 void
 clear_waiting_for_input ()
 {
-  /* Tell interrupt_signal not to throw back to read_char,  */
+  /* Tell handle_interrupt not to throw back to read_char,  */
   waiting_for_input = 0;
   input_available_clear_time = 0;
 }
@@ -10263,16 +10261,16 @@
 
    Otherwise it sets the Lisp variable quit-flag not-nil.  This causes
    eval to throw, when it gets a chance.  If quit-flag is already
-   non-nil, it stops the job right away.  */
+   non-nil, it stops the job right away.
+
+   XXX This comment needs to be updated.  */
 
 static SIGTYPE
 interrupt_signal (signalnum)	/* If we don't have an argument, */
      int signalnum;		/* some compilers complain in signal calls. */
 {
-  char c;
   /* Must preserve main program's value of errno.  */
   int old_errno = errno;
-  struct frame *sf = SELECTED_FRAME ();
 
 #if defined (USG) && !defined (POSIX_SIGNALS)
   /* USG systems forget handlers when they are used;
@@ -10298,6 +10296,20 @@
       return;
     }
 
+  handle_interrupt ();
+
+  errno = old_errno;
+}
+
+/* C-g processing, signal independent code.
+
+   XXX Expand this comment.  */
+static void
+handle_interrupt ()
+{
+  char c; 
+  struct frame *sf = SELECTED_FRAME ();
+
   cancel_echoing ();
 
   /* XXX This code needs to be revised for multi-tty support. */
@@ -10418,8 +10430,6 @@
 
   if (waiting_for_input && !echoing)
     quit_throw_to_read_char ();
-
-  errno = old_errno;
 }
 
 /* Handle a C-g by making read_char return C-g.  */