# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1263291051 -32400 # Node ID 311d96e388e81871df11aa6fe4bb81d136bbf7e8 # Parent 0ff664c52820f629711fdf17f5431c98625e1645 * keyboard.c (read_char): Don't apply previous change when current buffer is unchanged by command execution. diff -r 0ff664c52820 -r 311d96e388e8 src/ChangeLog --- a/src/ChangeLog Tue Jan 12 09:14:45 2010 +0100 +++ b/src/ChangeLog Tue Jan 12 19:10:51 2010 +0900 @@ -1,3 +1,8 @@ +2010-01-12 YAMAMOTO Mitsuharu + + * keyboard.c (read_char): Don't apply previous change when current + buffer is unchanged by command execution. + 2010-01-12 Jan Djärv * keyboard.c (read_char): Return after executing from special map. diff -r 0ff664c52820 -r 311d96e388e8 src/keyboard.c --- a/src/keyboard.c Tue Jan 12 09:14:45 2010 +0100 +++ b/src/keyboard.c Tue Jan 12 19:10:51 2010 +0900 @@ -3155,6 +3155,7 @@ if (!NILP (tem)) { + struct buffer *prev_buffer = current_buffer; #if 0 /* This shouldn't be necessary anymore. --lorentey */ int was_locked = single_kboard; int count = SPECPDL_INDEX (); @@ -3178,10 +3179,16 @@ unbind_to (count, Qnil); #endif - /* The command may have changed the keymaps. Pretend there is input - in another keyboard and return. This will recalculate keymaps. */ - c = make_number (-2); - goto exit; + if (current_buffer != prev_buffer) + { + /* The command may have changed the keymaps. Pretend there + is input in another keyboard and return. This will + recalculate keymaps. */ + c = make_number (-2); + goto exit; + } + else + goto retry; } /* Handle things that only apply to characters. */