aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-05 17:03:51 +0000
committerGerd Moellmann2000-12-05 17:03:51 +0000
commit52be17cc7111b281eceb17aae0c0adad307d51c9 (patch)
tree67ba171f7ed12cf7b2633d1dbd85cf72ad719344 /src
parent5c62b2e97a406a7d05a3bfddd49b091791efaec0 (diff)
downloademacs-52be17cc7111b281eceb17aae0c0adad307d51c9.tar.gz
emacs-52be17cc7111b281eceb17aae0c0adad307d51c9.zip
(record_char): Don't record identical help-echo
events in recent_keys.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/keyboard.c37
2 files changed, 34 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 39b0f4f7fb4..93914d08815 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12000-12-05 Gerd Moellmann <gerd@gnu.org> 12000-12-05 Gerd Moellmann <gerd@gnu.org>
2 2
3 * keyboard.c (record_char): Don't record identical help-echo
4 events in recent_keys.
5
3 * xterm.c [USE_X_TOOLKIT]: Close the display. 6 * xterm.c [USE_X_TOOLKIT]: Close the display.
4 (xim_close_dpy): Handle case that the display has been closed. 7 (xim_close_dpy): Handle case that the display has been closed.
5 8
diff --git a/src/keyboard.c b/src/keyboard.c
index b23e08959e4..26d35936316 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2894,18 +2894,43 @@ record_char (c)
2894 Lisp_Object help; 2894 Lisp_Object help;
2895 2895
2896 /* Don't record `help-echo' in recent_keys unless it shows some help 2896 /* Don't record `help-echo' in recent_keys unless it shows some help
2897 message. */ 2897 message, and a different help than the previoiusly recorded
2898 if (!CONSP (c) 2898 event. */
2899 || !EQ (XCAR (c), Qhelp_echo) 2899 if (CONSP (c) && EQ (XCAR (c), Qhelp_echo))
2900 || (help = Fnth (make_number (2), c), 2900 {
2901 !NILP (help))) 2901 Lisp_Object help;
2902
2903 help = Fnth (make_number (2), c);
2904 if (STRINGP (help))
2905 {
2906 int last_idx;
2907 Lisp_Object last_c, last_help;
2908
2909 last_idx = recent_keys_index - 1;
2910 if (last_idx < 0)
2911 last_idx = NUM_RECENT_KEYS - 1;
2912 last_c = AREF (recent_keys, last_idx);
2913
2914 if (!CONSP (last_c)
2915 || !EQ (XCAR (last_c), Qhelp_echo)
2916 || (last_help = Fnth (make_number (2), last_c),
2917 !EQ (last_help, help)))
2918 {
2919 total_keys++;
2920 ASET (recent_keys, recent_keys_index, c);
2921 if (++recent_keys_index >= NUM_RECENT_KEYS)
2922 recent_keys_index = 0;
2923 }
2924 }
2925 }
2926 else
2902 { 2927 {
2903 total_keys++; 2928 total_keys++;
2904 ASET (recent_keys, recent_keys_index, c); 2929 ASET (recent_keys, recent_keys_index, c);
2905 if (++recent_keys_index >= NUM_RECENT_KEYS) 2930 if (++recent_keys_index >= NUM_RECENT_KEYS)
2906 recent_keys_index = 0; 2931 recent_keys_index = 0;
2907 } 2932 }
2908 2933
2909 /* Write c to the dribble file. If c is a lispy event, write 2934 /* Write c to the dribble file. If c is a lispy event, write
2910 the event's symbol to the dribble file, in <brackets>. Bleaugh. 2935 the event's symbol to the dribble file, in <brackets>. Bleaugh.
2911 If you, dear reader, have a better idea, you've got the source. :-) */ 2936 If you, dear reader, have a better idea, you've got the source. :-) */