args points to slot holding list of
unevalled args */
char evalargs;
+ /* Nonzero means call value of debugger when done with this operation. */
+ char debug_on_exit;
};
#ifdef MULTI_KBOARD
#endif
/* Non-nil disable property on a command means
- do not execute it; call disabled-command-hook's value instead. */
-Lisp_Object Qdisabled, Qdisabled_command_hook;
+ do not execute it; call disabled-command-function's value instead. */
+Lisp_Object Qdisabled, Qdisabled_command_function;
#define NUM_RECENT_KEYS (100)
int recent_keys_index; /* Index for storing next element into recent_keys */
/* We are unable to use interrupts if FIONREAD is not available,
so flush SIGIO so we won't try. */
-#ifndef FIONREAD
+#if !defined (FIONREAD) || defined(HAVE_CARBON)
#ifdef SIGIO
#undef SIGIO
#endif
to support it. */
static int cannot_suspend;
+extern Lisp_Object Qidentity, Qonly;
+\f
/* Install the string STR as the beginning of the string of echoing,
so that it serves as a prompt for the next character.
Also start echoing. */
== SCHARS (current_kboard->echo_string))
return;
+ /* Do nothing if we have already put a dash at the end. */
+ if (SCHARS (current_kboard->echo_string) > 1)
+ {
+ Lisp_Object last_char, prev_char, idx;
+
+ idx = make_number (SCHARS (current_kboard->echo_string) - 2);
+ prev_char = Faref (current_kboard->echo_string, idx);
+
+ idx = make_number (SCHARS (current_kboard->echo_string) - 1);
+ last_char = Faref (current_kboard->echo_string, idx);
+
+ if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
+ return;
+ }
+
/* Put a dash at the end of the buffer temporarily,
but make it go away when the next character is added. */
current_kboard->echo_string = concat2 (current_kboard->echo_string,
int count = SPECPDL_INDEX ();
Lisp_Object buffer;
+ /* If we enter while input is blocked, don't lock up here.
+ This may happen through the debugger during redisplay. */
+ if (INPUT_BLOCKED_P)
+ return Qnil;
+
command_loop_level++;
update_mode_lines = 1;
#endif
}
+/* If we're in single_kboard state for kboard KBOARD,
+ get out of it. */
+
+void
+not_single_kboard_state (kboard)
+ KBOARD *kboard;
+{
+#ifdef MULTI_KBOARD
+ if (kboard == current_kboard)
+ single_kboard = 0;
+#endif
+}
+
/* Maintain a stack of kboards, so other parts of Emacs
can switch temporarily to the kboard of a given frame
and then revert to the previous status. */
Vinhibit_quit = Qnil;
#ifdef MULTI_KBOARD
- any_kboard_state ();
+ if (command_loop_level == 0 && minibuf_level == 0)
+ any_kboard_state ();
#endif
return make_number (0);
while (1)
{
internal_catch (Qtop_level, top_level_1, Qnil);
+ /* Reset single_kboard in case top-level set it while
+ evaluating an -f option, or we are stuck there for some
+ other reason. */
+ any_kboard_state ();
internal_catch (Qtop_level, command_loop_2, Qnil);
executing_macro = Qnil;
if (display_hourglass_p)
cancel_hourglass ();
#endif
+
+ /* Unblock input if we enter with input blocked. This may happen if
+ redisplay traps e.g. during tool-bar update with input blocked. */
+ while (INPUT_BLOCKED_P)
+ UNBLOCK_INPUT;
+
return Fthrow (Qtop_level, Qnil);
}
Lisp_Object arg;
{
cancel_hourglass ();
+ return Qnil;
}
#endif
call1 (Vrun_hooks, intern ("activate-mark-hook"));
}
+ /* Setting transient-mark-mode to `only' is a way of
+ turning it on for just one command. */
+ if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
+ {
+ if (EQ (Vtransient_mark_mode, Qidentity))
+ Vtransient_mark_mode = Qnil;
+ if (EQ (Vtransient_mark_mode, Qonly))
+ Vtransient_mark_mode = Qidentity;
+ }
+
finalize:
if (current_buffer == prev_buffer
else if (event->kind == LANGUAGE_CHANGE_EVENT)
{
/* Make an event (language-change (FRAME CHARSET LCID)). */
- obj = Fcons (event->modifiers, Qnil);
- obj = Fcons (event->code, obj);
- obj = Fcons (event->frame_or_window, obj);
+ obj = Fcons (event->frame_or_window, Qnil);
obj = Fcons (Qlanguage_change, Fcons (obj, Qnil));
kbd_fetch_ptr = event + 1;
}
{
int len = SBYTES (name_alist_or_stem);
char *buf = (char *) alloca (len + 50);
- if (sizeof (int) == sizeof (EMACS_INT))
- sprintf (buf, "%s-%d", SDATA (name_alist_or_stem),
- XINT (symbol_int) + 1);
- else if (sizeof (long) == sizeof (EMACS_INT))
- sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
- XINT (symbol_int) + 1);
+ sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
+ (long) XINT (symbol_int) + 1);
value = intern (buf);
}
else if (name_table != 0 && name_table[symbol_num])
tem = Fget (cmd, Qdisabled);
if (!NILP (tem) && !NILP (Vrun_hooks))
{
- tem = Fsymbol_value (Qdisabled_command_hook);
+ tem = Fsymbol_value (Qdisabled_command_function);
if (!NILP (tem))
- return call1 (Vrun_hooks, Qdisabled_command_hook);
+ return call1 (Vrun_hooks, Qdisabled_command_function);
}
}
backtrace.args = &cmd;
backtrace.nargs = 1;
backtrace.evalargs = 0;
+ backtrace.debug_on_exit = 0;
tem = Fcall_interactively (cmd, record_flag, keys);
else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4)
strcpy (buf, "C-u ");
else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg)))
- {
- if (sizeof (int) == sizeof (EMACS_INT))
- sprintf (buf, "%d ", XINT (XCAR (prefixarg)));
- else if (sizeof (long) == sizeof (EMACS_INT))
- sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));
- else
- abort ();
- }
+ sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg)));
else if (INTEGERP (prefixarg))
- {
- if (sizeof (int) == sizeof (EMACS_INT))
- sprintf (buf, "%d ", XINT (prefixarg));
- else if (sizeof (long) == sizeof (EMACS_INT))
- sprintf (buf, "%ld ", (long) XINT (prefixarg));
- else
- abort ();
- }
+ sprintf (buf, "%ld ", (long) XINT (prefixarg));
/* This isn't strictly correct if execute-extended-command
is bound to anything else. Perhaps it should use
stuff_buffered_input (stuffstring)
Lisp_Object stuffstring;
{
-/* stuff_char works only in BSD, versions 4.2 and up. */
-#ifdef BSD_SYSTEM
-#ifndef BSD4_1
+#ifdef SIGTSTP /* stuff_char is defined if SIGTSTP. */
register unsigned char *p;
if (STRINGP (stuffstring))
/* Anything we have read ahead, put back for the shell to read. */
/* ?? What should this do when we have multiple keyboards??
- Should we ignore anything that was typed in at the "wrong" kboard? */
+ Should we ignore anything that was typed in at the "wrong" kboard?
+
+ rms: we should stuff everything back into the kboard
+ it came from. */
for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++)
{
}
input_pending = 0;
-#endif
-#endif /* BSD_SYSTEM and not BSD4_1 */
+#endif /* SIGTSTP */
}
\f
void
POS defaults to point in WINDOW; WINDOW defaults to the selected window.
Return nil if position is not visible in window. Otherwise,
-the return value is similar to that returned by event-start for
+the return value is similar to that returned by `event-start' for
a mouse click at the upper left corner of the glyph corresponding
to the given buffer position:
(WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
Qtimer_event_handler = intern ("timer-event-handler");
staticpro (&Qtimer_event_handler);
- Qdisabled_command_hook = intern ("disabled-command-hook");
- staticpro (&Qdisabled_command_hook);
+ Qdisabled_command_function = intern ("disabled-command-function");
+ staticpro (&Qdisabled_command_function);
Qself_insert_command = intern ("self-insert-command");
staticpro (&Qself_insert_command);
DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table,
doc: /* Translate table for keyboard input, or nil.
-Each character is looked up in this string and the contents used instead.
-The value may be a string, a vector, or a char-table.
-If it is a string or vector of length N,
-character codes N and up are untranslated.
-In a vector or a char-table, an element which is nil means "no translation".
+If non-nil, the value should be a char-table. Each character read
+from the keyboard is looked up in this char-table. If the value found
+there is non-nil, then it is used instead of the actual input character.
+
+The value can also be a string or vector, but this is considered obsolete.
+If it is a string or vector of length N, character codes N and up are left
+untranslated. In a vector, an element which is nil means "no translation".
This is applied to the characters supplied to input methods, not their
output. See also `translation-table-for-input'. */);
doc: /* Per-terminal keymap that overrides all other local keymaps.
If this variable is non-nil, it is used as a keymap instead of the
buffer's local map, and the minor mode keymaps and text property keymaps.
+It also overrides `overriding-local-map'.
This variable is intended to let commands such as `universal-argument'
set up a different keymap for reading the next command. */);
After a command is executed, if point is moved into a region that has
special properties (e.g. composition, display), we adjust point to
-the boundary of the region. But, several special commands sets this
-variable to non-nil, then we suppress the point adjustment.
+the boundary of the region. But, when a command sets this variable to
+non-nil, we suppress the point adjustment.
This variable is set to nil before reading a command, and is checked
just after executing the command. */);