diff options
| author | Eli Zaretskii | 2019-03-20 11:21:54 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2019-03-20 11:21:54 +0200 |
| commit | f13d97b4de02586cce49909aa2f3f51fcb5daa5f (patch) | |
| tree | a467b0e89bd82d81a1ece2f94b69872b6312c28e /src | |
| parent | 047c1b19353ff58d8cd45935c7b44c911b70e312 (diff) | |
| download | emacs-f13d97b4de02586cce49909aa2f3f51fcb5daa5f.tar.gz emacs-f13d97b4de02586cce49909aa2f3f51fcb5daa5f.zip | |
Fix defining keyboard macros in CUA mode
* lisp/emulation/cua-base.el (cua--prefix-override-replay):
Push the key to replace wrapped in '(no-record . KEY)', so
that it doesn't get recorded more than once. (Bug#34901)
* src/keyboard.c (read_char): Handle the '(no-record . KEY)'
event by substituting KEY for it.
(syms_of_keyboard) <no-record>: New DEFSYM.
<unread-command-events>: Update the doc string.
* doc/lispref/commands.texi (Event Input Misc): Document the
'(no-record . EVENT)' form.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 22e4377ee86..362bd663878 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2364,7 +2364,14 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2364 | if (CONSP (c) && EQ (XCAR (c), Qt)) | 2364 | if (CONSP (c) && EQ (XCAR (c), Qt)) |
| 2365 | c = XCDR (c); | 2365 | c = XCDR (c); |
| 2366 | else | 2366 | else |
| 2367 | reread = true; | 2367 | { |
| 2368 | if (CONSP (c) && EQ (XCAR (c), Qno_record)) | ||
| 2369 | { | ||
| 2370 | c = XCDR (c); | ||
| 2371 | recorded = true; | ||
| 2372 | } | ||
| 2373 | reread = true; | ||
| 2374 | } | ||
| 2368 | 2375 | ||
| 2369 | /* Undo what read_char_x_menu_prompt did when it unread | 2376 | /* Undo what read_char_x_menu_prompt did when it unread |
| 2370 | additional keys returned by Fx_popup_menu. */ | 2377 | additional keys returned by Fx_popup_menu. */ |
| @@ -2745,7 +2752,14 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2745 | if (CONSP (c) && EQ (XCAR (c), Qt)) | 2752 | if (CONSP (c) && EQ (XCAR (c), Qt)) |
| 2746 | c = XCDR (c); | 2753 | c = XCDR (c); |
| 2747 | else | 2754 | else |
| 2748 | reread = true; | 2755 | { |
| 2756 | if (CONSP (c) && EQ (XCAR (c), Qno_record)) | ||
| 2757 | { | ||
| 2758 | c = XCDR (c); | ||
| 2759 | recorded = true; | ||
| 2760 | } | ||
| 2761 | reread = true; | ||
| 2762 | } | ||
| 2749 | } | 2763 | } |
| 2750 | 2764 | ||
| 2751 | /* Read something from current KBOARD's side queue, if possible. */ | 2765 | /* Read something from current KBOARD's side queue, if possible. */ |
| @@ -2807,6 +2821,11 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2807 | 2821 | ||
| 2808 | if (CONSP (c) && EQ (XCAR (c), Qt)) | 2822 | if (CONSP (c) && EQ (XCAR (c), Qt)) |
| 2809 | c = XCDR (c); | 2823 | c = XCDR (c); |
| 2824 | else if (CONSP (c) && EQ (XCAR (c), Qno_record)) | ||
| 2825 | { | ||
| 2826 | c = XCDR (c); | ||
| 2827 | recorded = true; | ||
| 2828 | } | ||
| 2810 | } | 2829 | } |
| 2811 | 2830 | ||
| 2812 | non_reread: | 2831 | non_reread: |
| @@ -11193,6 +11212,7 @@ syms_of_keyboard (void) | |||
| 11193 | Fput (var, Qevent_symbol_elements, list1 (var)); | 11212 | Fput (var, Qevent_symbol_elements, list1 (var)); |
| 11194 | } | 11213 | } |
| 11195 | } | 11214 | } |
| 11215 | DEFSYM (Qno_record, "no-record"); | ||
| 11196 | 11216 | ||
| 11197 | button_down_location = make_nil_vector (5); | 11217 | button_down_location = make_nil_vector (5); |
| 11198 | staticpro (&button_down_location); | 11218 | staticpro (&button_down_location); |
| @@ -11303,7 +11323,9 @@ so that you can determine whether the command was run by mouse or not. */); | |||
| 11303 | These events are processed first, before actual keyboard input. | 11323 | These events are processed first, before actual keyboard input. |
| 11304 | Events read from this list are not normally added to `this-command-keys', | 11324 | Events read from this list are not normally added to `this-command-keys', |
| 11305 | as they will already have been added once as they were read for the first time. | 11325 | as they will already have been added once as they were read for the first time. |
| 11306 | An element of the form (t . EVENT) forces EVENT to be added to that list. */); | 11326 | An element of the form (t . EVENT) forces EVENT to be added to that list. |
| 11327 | An element of the form (no-record . EVENT) means process EVENT, but do not | ||
| 11328 | record it in the keyboard macros, recent-keys, and the dribble file. */); | ||
| 11307 | Vunread_command_events = Qnil; | 11329 | Vunread_command_events = Qnil; |
| 11308 | 11330 | ||
| 11309 | DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events, | 11331 | DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events, |