diff options
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2010-01-12 19:10:51 +0900 |
---|---|---|
committer | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 2010-01-12 19:10:51 +0900 |
commit | 4a00eacab800ebf14e85af2a0251f14d49a90981 (patch) | |
tree | cbeae7d72b29f8e6f1eb847d672aca4bde3372a6 | |
parent | 60abb2870ba8d0314cde544d62dbb24aa53b8074 (diff) | |
download | emacs-4a00eacab800ebf14e85af2a0251f14d49a90981.tar.gz |
* keyboard.c (read_char): Don't apply previous change when current
buffer is unchanged by command execution.
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/keyboard.c | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f52cf8fee63..e5bdc50f1c7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * keyboard.c (read_char): Don't apply previous change when current + buffer is unchanged by command execution. + 2010-01-12 Jan Djärv <jan.h.d@swipnet.se> * keyboard.c (read_char): Return after executing from special map. diff --git a/src/keyboard.c b/src/keyboard.c index 8bd8cf30468..3b57c6e470f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3155,6 +3155,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) 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 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) 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. */ |