]> code.delx.au - gnu-emacs/blobdiff - src/blockinput.h
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-29
[gnu-emacs] / src / blockinput.h
index a4c8a9b9c2285e32e79b70d479bda4e929b504da..6aa865ea9be346015df830aa8f64b1c4d68fb39f 100644 (file)
@@ -94,7 +94,28 @@ extern int pending_atimers;
     }                                          \
   while (0)
 
-#define TOTALLY_UNBLOCK_INPUT (interrupt_input_blocked = 0)
+/* Undo any number of BLOCK_INPUT calls,
+   and also reinvoke any pending signal.  */
+
+#define TOTALLY_UNBLOCK_INPUT                  \
+  do if (interrupt_input_blocked != 0)         \
+    {                                          \
+      interrupt_input_blocked = 1;             \
+      UNBLOCK_INPUT;                           \
+    }                                          \
+  while (0)
+
+/* Undo any number of BLOCK_INPUT calls down to level LEVEL,
+   and also (if the level is now 0) reinvoke any pending signal.  */
+
+#define UNBLOCK_INPUT_TO(LEVEL)                                \
+  do                                                   \
+    {                                                  \
+      interrupt_input_blocked = (LEVEL) + 1;           \
+      UNBLOCK_INPUT;                                   \
+    }                                                  \
+  while (0)
+
 #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT
 
 /* In critical section ? */