diff options
| author | Stefan Monnier | 2021-01-04 22:57:21 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2021-01-04 23:41:19 -0500 |
| commit | d6f30e5632b1c9cf43ebfbdbf164d5c54be33475 (patch) | |
| tree | d358a335c8404ba9233379b5baf8bf158da90487 /src | |
| parent | 898a94a9be06a3ab51116778f6b4a263f832759d (diff) | |
| download | emacs-d6f30e5632b1c9cf43ebfbdbf164d5c54be33475.tar.gz emacs-d6f30e5632b1c9cf43ebfbdbf164d5c54be33475.zip | |
* lisp/subr.el (global-map): Initialize inside declaration.
* src/commands.h (global_map):
* src/keymap.c (global_map): Delete variable.
(syms_of_keymap): Don't initialize global_map here.
(keys_of_keymap): Delete function.
* src/lisp.h (keys_of_cmds):
* src/cmds.c (keys_of_cmds): Delete function.
* src/emacs.c (main): Don't call them.
* src/window.c (keys_of_window): Don't initialize global_map here.
* src/keyboard.c (keys_of_keyboard): Don't initialize global_map here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmds.c | 21 | ||||
| -rw-r--r-- | src/commands.h | 1 | ||||
| -rw-r--r-- | src/emacs.c | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 2 | ||||
| -rw-r--r-- | src/keymap.c | 15 | ||||
| -rw-r--r-- | src/keymap.h | 1 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/window.c | 1 |
8 files changed, 1 insertions, 43 deletions
diff --git a/src/cmds.c b/src/cmds.c index 798fd68a920..1547db80e88 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -529,24 +529,3 @@ This is run after inserting the character. */); | |||
| 529 | defsubr (&Sdelete_char); | 529 | defsubr (&Sdelete_char); |
| 530 | defsubr (&Sself_insert_command); | 530 | defsubr (&Sself_insert_command); |
| 531 | } | 531 | } |
| 532 | |||
| 533 | void | ||
| 534 | keys_of_cmds (void) | ||
| 535 | { | ||
| 536 | int n; | ||
| 537 | |||
| 538 | initial_define_key (global_map, Ctl ('I'), "self-insert-command"); | ||
| 539 | for (n = 040; n < 0177; n++) | ||
| 540 | initial_define_key (global_map, n, "self-insert-command"); | ||
| 541 | #ifdef MSDOS | ||
| 542 | for (n = 0200; n < 0240; n++) | ||
| 543 | initial_define_key (global_map, n, "self-insert-command"); | ||
| 544 | #endif | ||
| 545 | for (n = 0240; n < 0400; n++) | ||
| 546 | initial_define_key (global_map, n, "self-insert-command"); | ||
| 547 | |||
| 548 | initial_define_key (global_map, Ctl ('A'), "beginning-of-line"); | ||
| 549 | initial_define_key (global_map, Ctl ('B'), "backward-char"); | ||
| 550 | initial_define_key (global_map, Ctl ('E'), "end-of-line"); | ||
| 551 | initial_define_key (global_map, Ctl ('F'), "forward-char"); | ||
| 552 | } | ||
diff --git a/src/commands.h b/src/commands.h index a09858d050d..be6f5823bcc 100644 --- a/src/commands.h +++ b/src/commands.h | |||
| @@ -27,7 +27,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 27 | calls to initial_define_key. These should *not* be used after | 27 | calls to initial_define_key. These should *not* be used after |
| 28 | initialization; use-global-map doesn't affect these; it sets | 28 | initialization; use-global-map doesn't affect these; it sets |
| 29 | current_global_map instead. */ | 29 | current_global_map instead. */ |
| 30 | extern Lisp_Object global_map; | ||
| 31 | extern Lisp_Object meta_map; | 30 | extern Lisp_Object meta_map; |
| 32 | extern Lisp_Object control_x_map; | 31 | extern Lisp_Object control_x_map; |
| 33 | 32 | ||
diff --git a/src/emacs.c b/src/emacs.c index fe8dcb1c476..3c293d85edd 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1957,10 +1957,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1957 | #endif | 1957 | #endif |
| 1958 | 1958 | ||
| 1959 | keys_of_casefiddle (); | 1959 | keys_of_casefiddle (); |
| 1960 | keys_of_cmds (); | ||
| 1961 | keys_of_buffer (); | 1960 | keys_of_buffer (); |
| 1962 | keys_of_keyboard (); | 1961 | keys_of_keyboard (); |
| 1963 | keys_of_keymap (); | ||
| 1964 | keys_of_window (); | 1962 | keys_of_window (); |
| 1965 | } | 1963 | } |
| 1966 | else | 1964 | else |
diff --git a/src/keyboard.c b/src/keyboard.c index cf15cd73572..52d913c537d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -12388,10 +12388,8 @@ syms_of_keyboard_for_pdumper (void) | |||
| 12388 | void | 12388 | void |
| 12389 | keys_of_keyboard (void) | 12389 | keys_of_keyboard (void) |
| 12390 | { | 12390 | { |
| 12391 | initial_define_key (global_map, Ctl ('Z'), "suspend-emacs"); | ||
| 12392 | initial_define_key (control_x_map, Ctl ('Z'), "suspend-emacs"); | 12391 | initial_define_key (control_x_map, Ctl ('Z'), "suspend-emacs"); |
| 12393 | initial_define_key (meta_map, Ctl ('C'), "exit-recursive-edit"); | 12392 | initial_define_key (meta_map, Ctl ('C'), "exit-recursive-edit"); |
| 12394 | initial_define_key (global_map, Ctl (']'), "abort-recursive-edit"); | ||
| 12395 | initial_define_key (meta_map, 'x', "execute-extended-command"); | 12393 | initial_define_key (meta_map, 'x', "execute-extended-command"); |
| 12396 | 12394 | ||
| 12397 | initial_define_lispy_key (Vspecial_event_map, "delete-frame", | 12395 | initial_define_lispy_key (Vspecial_event_map, "delete-frame", |
diff --git a/src/keymap.c b/src/keymap.c index 1eeea81f627..772ced42ccd 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -59,8 +59,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 59 | 59 | ||
| 60 | Lisp_Object current_global_map; /* Current global keymap. */ | 60 | Lisp_Object current_global_map; /* Current global keymap. */ |
| 61 | 61 | ||
| 62 | Lisp_Object global_map; /* Default global key bindings. */ | ||
| 63 | |||
| 64 | Lisp_Object meta_map; /* The keymap used for globally bound | 62 | Lisp_Object meta_map; /* The keymap used for globally bound |
| 65 | ESC-prefixed default commands. */ | 63 | ESC-prefixed default commands. */ |
| 66 | 64 | ||
| @@ -3195,11 +3193,7 @@ syms_of_keymap (void) | |||
| 3195 | Each one is the value of a Lisp variable, and is also | 3193 | Each one is the value of a Lisp variable, and is also |
| 3196 | pointed to by a C variable */ | 3194 | pointed to by a C variable */ |
| 3197 | 3195 | ||
| 3198 | global_map = Fmake_keymap (Qnil); | 3196 | current_global_map = Qnil; |
| 3199 | Fset (intern_c_string ("global-map"), global_map); | ||
| 3200 | |||
| 3201 | current_global_map = global_map; | ||
| 3202 | staticpro (&global_map); | ||
| 3203 | staticpro (¤t_global_map); | 3197 | staticpro (¤t_global_map); |
| 3204 | 3198 | ||
| 3205 | meta_map = Fmake_keymap (Qnil); | 3199 | meta_map = Fmake_keymap (Qnil); |
| @@ -3328,10 +3322,3 @@ be preferred. */); | |||
| 3328 | defsubr (&Swhere_is_internal); | 3322 | defsubr (&Swhere_is_internal); |
| 3329 | defsubr (&Sdescribe_buffer_bindings); | 3323 | defsubr (&Sdescribe_buffer_bindings); |
| 3330 | } | 3324 | } |
| 3331 | |||
| 3332 | void | ||
| 3333 | keys_of_keymap (void) | ||
| 3334 | { | ||
| 3335 | initial_define_key (global_map, 033, "ESC-prefix"); | ||
| 3336 | initial_define_key (global_map, Ctl ('X'), "Control-X-prefix"); | ||
| 3337 | } | ||
diff --git a/src/keymap.h b/src/keymap.h index 072c09348e2..1967025dcb4 100644 --- a/src/keymap.h +++ b/src/keymap.h | |||
| @@ -40,7 +40,6 @@ extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **); | |||
| 40 | extern void initial_define_key (Lisp_Object, int, const char *); | 40 | extern void initial_define_key (Lisp_Object, int, const char *); |
| 41 | extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); | 41 | extern void initial_define_lispy_key (Lisp_Object, const char *, const char *); |
| 42 | extern void syms_of_keymap (void); | 42 | extern void syms_of_keymap (void); |
| 43 | extern void keys_of_keymap (void); | ||
| 44 | 43 | ||
| 45 | typedef void (*map_keymap_function_t) | 44 | typedef void (*map_keymap_function_t) |
| 46 | (Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data); | 45 | (Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data); |
diff --git a/src/lisp.h b/src/lisp.h index 5cc735be86c..d259e950dab 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3561,7 +3561,6 @@ extern void swap_in_global_binding (struct Lisp_Symbol *); | |||
| 3561 | 3561 | ||
| 3562 | /* Defined in cmds.c */ | 3562 | /* Defined in cmds.c */ |
| 3563 | extern void syms_of_cmds (void); | 3563 | extern void syms_of_cmds (void); |
| 3564 | extern void keys_of_cmds (void); | ||
| 3565 | 3564 | ||
| 3566 | /* Defined in coding.c. */ | 3565 | /* Defined in coding.c. */ |
| 3567 | extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, | 3566 | extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t, |
diff --git a/src/window.c b/src/window.c index ba8682eed7c..f2862a287d6 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -8590,7 +8590,6 @@ keys_of_window (void) | |||
| 8590 | initial_define_key (control_x_map, '<', "scroll-left"); | 8590 | initial_define_key (control_x_map, '<', "scroll-left"); |
| 8591 | initial_define_key (control_x_map, '>', "scroll-right"); | 8591 | initial_define_key (control_x_map, '>', "scroll-right"); |
| 8592 | 8592 | ||
| 8593 | initial_define_key (global_map, Ctl ('V'), "scroll-up-command"); | ||
| 8594 | initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); | 8593 | initial_define_key (meta_map, Ctl ('V'), "scroll-other-window"); |
| 8595 | initial_define_key (meta_map, 'v', "scroll-down-command"); | 8594 | initial_define_key (meta_map, 'v', "scroll-down-command"); |
| 8596 | } | 8595 | } |