/* Last size recorded for a current buffer which is not a minibuffer. */
static ptrdiff_t last_non_minibuf_size;
-/* Total number of times read_char has returned, modulo UINTMAX_MAX + 1. */
uintmax_t num_input_events;
+ptrdiff_t point_before_last_command_or_undo;
+struct buffer *buffer_before_last_command_or_undo;
/* Value of num_nonmacro_input_events as of last auto save. */
static EMACS_INT last_auto_save;
-/* The value of point when the last command was started. */
+/* The value of point when the last command was started. */
static ptrdiff_t last_point_position;
/* The frame in which the last input event occurred, or Qmacro if the
result of changes from the last command. */
call0 (Qundo_auto__add_boundary);
+ /* Record point and buffer, so we can put point into the undo
+ information if necessary. */
+ point_before_last_command_or_undo = PT;
+ buffer_before_last_command_or_undo = current_buffer;
+
call1 (Qcommand_execute, Vthis_command);
#ifdef HAVE_WINDOW_SYSTEM
#endif
))
{
- union buffered_input_event *event;
-
- event = ((kbd_fetch_ptr < kbd_buffer + KBD_BUFFER_SIZE)
- ? kbd_fetch_ptr
- : kbd_buffer);
+ union buffered_input_event *event = kbd_fetch_ptr;
do
{
+ if (event == kbd_buffer + KBD_BUFFER_SIZE)
+ event = kbd_buffer;
if (!(
#ifdef USE_TOOLKIT_SCROLL_BARS
(flags & READABLE_EVENTS_FILTER_EVENTS) &&
&& event->kind == BUFFER_SWITCH_EVENT))
return 1;
event++;
- if (event == kbd_buffer + KBD_BUFFER_SIZE)
- event = kbd_buffer;
}
while (event != kbd_store_ptr);
}
the function in which the error occurred is unconditionally removed, since
otherwise the error might happen repeatedly and make Emacs nonfunctional.
-See also `pre-command-hook'. */);
+See also `post-command-hook'. */);
Vpre_command_hook = Qnil;
DEFVAR_LISP ("post-command-hook", Vpost_command_hook,