aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2018-07-21 12:10:20 +0300
committerEli Zaretskii2018-07-21 12:10:20 +0300
commit03e3440dbbfea40b449a9f6f23a3630664275d11 (patch)
tree37ab03786de0ca04d0a8bfc7a74546f68a2c61fd /src
parent1780502da6b9ac8d3063dfd56f675318568283dc (diff)
downloademacs-03e3440dbbfea40b449a9f6f23a3630664275d11.tar.gz
emacs-03e3440dbbfea40b449a9f6f23a3630664275d11.zip
Fix recording keyboard macros when input method is active
* lisp/international/quail.el (quail-start-translation) (quail-start-conversion): Bind inhibit--record-char to t for the first character of a translated sequence. * src/keyboard.c (record_char): Don't record events from macros to dribble file, per documentation. (Fopen_dribble_file): Doc fix. (syms_of_keyboard) <inhibit--record-char>: New variable. (record_char): Don't record input event if inhibit--record-char is non-nil. (Bug#32108)
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index aa58e268435..01d7ce9d5e0 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3150,6 +3150,10 @@ help_char_p (Lisp_Object c)
3150static void 3150static void
3151record_char (Lisp_Object c) 3151record_char (Lisp_Object c)
3152{ 3152{
3153 /* quail.el binds this to avoid recording keys twice. */
3154 if (inhibit_record_char)
3155 return;
3156
3153 int recorded = 0; 3157 int recorded = 0;
3154 3158
3155 if (CONSP (c) && (EQ (XCAR (c), Qhelp_echo) || EQ (XCAR (c), Qmouse_movement))) 3159 if (CONSP (c) && (EQ (XCAR (c), Qhelp_echo) || EQ (XCAR (c), Qmouse_movement)))
@@ -3256,7 +3260,7 @@ record_char (Lisp_Object c)
3256 /* Write c to the dribble file. If c is a lispy event, write 3260 /* Write c to the dribble file. If c is a lispy event, write
3257 the event's symbol to the dribble file, in <brackets>. Bleaugh. 3261 the event's symbol to the dribble file, in <brackets>. Bleaugh.
3258 If you, dear reader, have a better idea, you've got the source. :-) */ 3262 If you, dear reader, have a better idea, you've got the source. :-) */
3259 if (dribble) 3263 if (dribble && NILP (Vexecuting_kbd_macro))
3260 { 3264 {
3261 block_input (); 3265 block_input ();
3262 if (INTEGERP (c)) 3266 if (INTEGERP (c))
@@ -10110,10 +10114,13 @@ DEFUN ("recursion-depth", Frecursion_depth, Srecursion_depth, 0, 0, 0,
10110 10114
10111DEFUN ("open-dribble-file", Fopen_dribble_file, Sopen_dribble_file, 1, 1, 10115DEFUN ("open-dribble-file", Fopen_dribble_file, Sopen_dribble_file, 1, 1,
10112 "FOpen dribble file: ", 10116 "FOpen dribble file: ",
10113 doc: /* Start writing all keyboard characters to a dribble file called FILE. 10117 doc: /* Start writing input events to a dribble file called FILE.
10114If FILE is nil, close any open dribble file. 10118If FILE is nil, close any open dribble file.
10115The file will be closed when Emacs exits. 10119The file will be closed when Emacs exits.
10116 10120
10121The events written to the file include keyboard and mouse input
10122events, but not events from executing keyboard macros.
10123
10117Be aware that this records ALL characters you type! 10124Be aware that this records ALL characters you type!
10118This may include sensitive information such as passwords. */) 10125This may include sensitive information such as passwords. */)
10119 (Lisp_Object file) 10126 (Lisp_Object file)
@@ -11848,6 +11855,14 @@ signals. */);
11848 Vwhile_no_input_ignore_events, 11855 Vwhile_no_input_ignore_events,
11849 doc: /* Ignored events from while-no-input. */); 11856 doc: /* Ignored events from while-no-input. */);
11850 Vwhile_no_input_ignore_events = Qnil; 11857 Vwhile_no_input_ignore_events = Qnil;
11858
11859 DEFVAR_BOOL ("inhibit--record-char",
11860 inhibit_record_char,
11861 doc: /* If non-nil, don't record input events.
11862This inhibits recording input events for the purposes of keyboard
11863macros, dribble file, and `recent-keys'.
11864Internal use only. */);
11865 inhibit_record_char = false;
11851} 11866}
11852 11867
11853void 11868void