changeset 24348:9365b6b93858

(Qusr1_signal, Qusr2_signal): New variables. (syms_of_emacs): Init and staticpro them. (handle_USR1_signal): Don't run any code, just queue up an event. (handle_USR2_signal): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Fri, 19 Feb 1999 01:34:48 +0000
parents eb03024d18fc
children b6c16b67b735
files src/emacs.c
diffstat 1 files changed, 28 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/emacs.c	Thu Feb 18 15:46:31 1999 +0000
+++ b/src/emacs.c	Fri Feb 19 01:34:48 1999 +0000
@@ -45,6 +45,7 @@
 #include "blockinput.h"
 #include "syssignal.h"
 #include "process.h"
+#include "termhooks.h"
 #include "keyboard.h"
 
 #ifdef HAVE_SETRLIMIT
@@ -116,6 +117,8 @@
 
 Lisp_Object Qfile_name_handler_alist;
 
+Lisp_Object Qusr1_signal, Qusr2_signal;
+
 /* If non-zero, emacs should not attempt to use an window-specific code,
    but instead should use the virtual terminal under which it was started */
 int inhibit_window_system;
@@ -180,40 +183,38 @@
 int fatal_error_in_progress;
 
 #ifdef SIGUSR1
-int SIGUSR1_in_progress=0;
 SIGTYPE
 handle_USR1_signal (sig)
      int sig;
 {
-  if (! SIGUSR1_in_progress)
-    {
-      SIGUSR1_in_progress = 1;
-      
-      if (!NILP (Vrun_hooks) && !noninteractive)
-	call1 (Vrun_hooks, intern ("signal-USR1-hook"));
-      
-      SIGUSR1_in_progress = 0;
-    }
+  struct input_event buf;
+
+  buf.kind = non_ascii_keystroke;
+  buf.code = Qusr1_signal;
+  buf.frame_or_window = Fselected_frame ();
+  buf.modifiers = 0;
+  buf.timestamp = 0;
+
+  kbd_buffer_store_event (&buf);
 }
+#endif /* SIGUSR1 */
 
 #ifdef SIGUSR2
-int SIGUSR2_in_progress=0;
 SIGTYPE
 handle_USR2_signal (sig)
      int sig;
 {
-  if (! SIGUSR2_in_progress)
-    {
-      SIGUSR2_in_progress = 1;
-      
-      if (!NILP (Vrun_hooks) && !noninteractive)
-	call1 (Vrun_hooks, intern ("signal-USR2-hook"));
-      
-      SIGUSR2_in_progress = 0;
-    }
+  struct input_event buf;
+
+  buf.kind = non_ascii_keystroke;
+  buf.code = Qusr2_signal;
+  buf.frame_or_window = Fselected_frame ();
+  buf.modifiers = 0;
+  buf.timestamp = 0;
+
+  kbd_buffer_store_event (&buf);
 }
-#endif
-#endif 
+#endif /* SIGUSR2 */
 
 /* Handle bus errors, illegal instruction, etc. */
 SIGTYPE
@@ -1859,6 +1860,11 @@
   Qfile_name_handler_alist = intern ("file-name-handler-alist");
   staticpro (&Qfile_name_handler_alist);
 
+  Qusr1_signal = intern ("usr1-signal");
+  staticpro (&Qusr1_signal);
+  Qusr2_signal = intern ("usr2-signal");
+  staticpro (&Qusr2_signal);
+
 #ifndef CANNOT_DUMP
 #ifdef HAVE_SHM
   defsubr (&Sdump_emacs_data);