Modified by Max Hailperin <max@nic.gac.edu> to support Schematik-style
authorChris Hanson <org/chris-hanson/cph>
Tue, 15 Oct 1991 18:01:55 +0000 (18:01 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 15 Oct 1991 18:01:55 +0000 (18:01 +0000)
interrupts if the environment variable USE_SCHEMATIK_STYLE_INTERRUPTS
is defined.  What this means is that the following signals are
redefined to generate the corresponding keyboard interrupt (to avoid
the unreliable behavior of the the interactive interrupt handler):

  signal     keyboard interrupt
  -----      ------------------
  SIGIOT     control-x
  SIGQUIT    control-u
  SIGHUP     control-b

v7/src/microcode/uxsig.c

index 26a6b62599c747ba59a887b9143f851f2d3e3196..8d310b66e721aa84ef6a575d4b0dfa16cd100c62 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.16 1991/08/31 03:59:11 arthur Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxsig.c,v 1.17 1991/10/15 18:01:55 cph Exp $
 
 Copyright (c) 1990-91 Massachusetts Institute of Technology
 
@@ -416,6 +416,21 @@ DEFUN_STD_HANDLER (sighnd_control_g,
     tty_set_next_interrupt_char (CONTROL_G_INTERRUPT_CHAR);
   })
 
+DEFUN_STD_HANDLER (sighnd_control_u,
+  {
+    tty_set_next_interrupt_char (CONTROL_U_INTERRUPT_CHAR);
+  })
+
+DEFUN_STD_HANDLER (sighnd_control_x,
+  {
+    tty_set_next_interrupt_char (CONTROL_X_INTERRUPT_CHAR);
+  })
+
+DEFUN_STD_HANDLER (sighnd_control_b,
+  {
+    tty_set_next_interrupt_char (CONTROL_B_INTERRUPT_CHAR);
+  })
+
 static void EXFUN
   (interactive_interrupt_handler, (struct FULL_SIGCONTEXT * scp));
 
@@ -634,15 +649,24 @@ DEFUN_VOID (UX_initialize_signals)
   bind_handler (SIGPIPE,       SIG_IGN);
   if ((isatty (STDIN_FILENO)) || option_emacs_subprocess)
     {
-      if (!option_emacs_subprocess)
+      if (getenv ("USE_SCHEMATIK_STYLE_INTERRUPTS"))
+        bind_handler (SIGHUP,   sighnd_control_b);
+      else if (!option_emacs_subprocess)
        bind_handler (SIGHUP,   sighnd_save_then_terminate);
-      bind_handler (SIGQUIT,   sighnd_interactive);
+      if (getenv ("USE_SCHEMATIK_STYLE_INTERRUPTS"))
+        bind_handler (SIGQUIT,  sighnd_control_u);
+      else
+        bind_handler (SIGQUIT, sighnd_interactive);
       bind_handler (SIGPWR,    sighnd_save_then_terminate);
       bind_handler (SIGTSTP,   sighnd_stop);
       bind_handler (SIGILL,    sighnd_hardware_trap);
       bind_handler (SIGTRAP,   sighnd_hardware_trap);
       bind_handler (SIGBUS,    sighnd_hardware_trap);
       bind_handler (SIGSEGV,   sighnd_hardware_trap);
+      if (getenv ("USE_SCHEMATIK_STYLE_INTERRUPTS"))
+        bind_handler (SIGIOT,   sighnd_control_x);
+      else
+        bind_handler (SIGIOT,  sighnd_software_trap);
       bind_handler (SIGIOT,    sighnd_software_trap);
       bind_handler (SIGEMT,    sighnd_software_trap);
       bind_handler (SIGSYS,    sighnd_software_trap);