/* Nonzero if input is available. */
int input_pending;
-/* Nonzero if should obey 0200 bit in input chars as "Meta". */
+/* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
+ keep 0200 bit in input chars. 0 to ignore the 0200 bit. */
+
int meta_key;
extern char *pending_malloc_warning;
dequeuing functions? Such a flag could be screwed up by interrupts
at inopportune times. */
-/* If this flag is non-zero, we will check mouse_moved to see when the
+/* If this flag is non-zero, we check mouse_moved to see when the
mouse moves, and motion events will appear in the input stream. If
- it is zero, mouse motion will be ignored. */
-int do_mouse_tracking;
+ it is zero, mouse motion is ignored. */
+static int do_mouse_tracking;
/* The window system handling code should set this if the mouse has
moved since the last call to the mouse_position_hook. Calling that
Vlast_event_frame = internal_last_event_frame = Qmacro;
#endif
- if (executing_macro_index >= XFASTINT (Flength (Vexecuting_macro)))
+ /* Exit the macro if we are at the end.
+ Also, some things replace the macro with t
+ to force an early exit. */
+ if (EQ (Vexecuting_macro, Qt)
+ || executing_macro_index >= XFASTINT (Flength (Vexecuting_macro)))
{
XSET (c, Lisp_Int, -1);
return c;
{
buf[i].kind = ascii_keystroke;
buf[i].modifiers = 0;
- if (meta_key && (cbuf[i] & 0x80))
+ if (meta_key == 1 && (cbuf[i] & 0x80))
buf[i].modifiers = meta_modifier;
- cbuf[i] &= ~0x80;
+ if (meta_key != 2)
+ cbuf[i] &= ~0x80;
XSET (buf[i].code, Lisp_Int, cbuf[i]);
#ifdef MULTI_FRAME
errno = old_errno;
}
#endif /* SIGIO */
+
+/* Send ourselves a SIGIO.
+
+ This function exists so that the UNBLOCK_INPUT macro in
+ blockinput.h can have some way to take care of input we put off
+ dealing with, without assuming that every file which uses
+ UNBLOCK_INPUT also has #included the files necessary to get SIGIO. */
+void
+reinvoke_input_signal ()
+{
+#ifdef SIGIO
+ kill (0, SIGIO);
+#endif
+}
+
+
\f
/* Return the prompt-string of a sparse keymap.
This is the first element which is a string.
realmaps[nmaps1++] = maps[mapno];
value = Fx_popup_menu (prev_event, Flist (nmaps1, realmaps));
+ if (CONSP (value))
+ {
+ /* If we got more than one event, put all but the first
+ onto this list to be read later.
+ Return just the first event now. */
+ unread_command_events
+ = nconc2 (XCONS (value)->cdr, unread_command_events);
+ value = XCONS (value)->car;
+ }
if (NILP (value))
XSET (value, Lisp_Int, quit_char);
if (used_mouse_menu)
nil means use CBREAK mode.\n\
Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal\n\
(no effect except in CBREAK mode).\n\
-Third arg META non-nil means accept 8-bit input (for a Meta key).\n\
- Otherwise, the top bit is ignored, on the assumption it is parity.\n\
+Third arg META t means accept 8-bit input (for a Meta key).\n\
+ META nil means ignore the top bit, on the assumption it is parity.\n\
+ Otherwise, accept 8-bit input and don't use the top bit for Meta.\n\
Optional fourth arg QUIT if non-nil specifies character to use for quitting.")
(interrupt, flow, meta, quit)
Lisp_Object interrupt, flow, meta, quit;
interrupt_input = 1;
#endif
flow_control = !NILP (flow);
- meta_key = !NILP (meta);
+ if (NILP (meta))
+ meta_key = 0;
+ else if (EQ (meta, Qt))
+ meta_key = 1;
+ else
+ meta_key = 2;
if (!NILP (quit))
/* Don't let this value be out of range. */
quit_char = XINT (quit) & (meta_key ? 0377 : 0177);
DEFVAR_INT ("extra-keyboard-modifiers", &extra_keyboard_modifiers,
"A mask of additional modifier keys to use with every keyboard character.\n\
-The modifiers of the character stored here apply to each keyboard\n\
-character we read. For example, after evaluating the expression\n\
+Emacs applies the modifiers of the character stored here to each keyboard\n\
+character it reads. For example, after evaluating the expression\n\
(setq extra-keyboard-modifiers ?\C-x)\n\
all input characters will have the control modifier applied to them.\n\
\n\