summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-12-29 21:40:28 -0800
committerJohn Wiegley <johnw@newartisans.com>2015-12-29 21:40:28 -0800
commit9f2f14a0725211b13a744573344636b57b9c98b9 (patch)
tree7190e0fb3d4aa06018d8cf997f06b806fb09a9c8 /src/keyboard.c
parentd259328fb87db8cc67d52771efcfa653e52c5b71 (diff)
parente823c34072bf045800d91e12c7ddb61fa23c6e30 (diff)
downloademacs-9f2f14a0725211b13a744573344636b57b9c98b9.tar.gz
Merge emacs-25 into master (using imerge)
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index ab7cb34a030..6fa38aa1328 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -195,14 +195,15 @@ Lisp_Object unread_switch_frame;
/* 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
@@ -1449,6 +1450,11 @@ command_loop_1 (void)
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
@@ -3313,14 +3319,12 @@ readable_events (int flags)
#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) &&
@@ -3337,8 +3341,6 @@ readable_events (int flags)
&& event->kind == BUFFER_SWITCH_EVENT))
return 1;
event++;
- if (event == kbd_buffer + KBD_BUFFER_SIZE)
- event = kbd_buffer;
}
while (event != kbd_store_ptr);
}
@@ -11372,7 +11374,7 @@ If an unhandled error happens in running this hook,
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,