mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-27 07:37:33 +00:00
* lisp/subr.el (esc-map): Initialize inside declaration
* src/commands.h (meta_map): * src/keymap.c (meta_map): Delete variable. (syms_of_keymap): Don't initialize esc-map here. (initial_define_key): * src/keymap.h (initial_define_key): Delete function. * src/keyboard.c (keys_of_keyboard): Don't initialize esc-map here. * src/window.h (keys_of_window): * src/window.c (keys_of_window): Delete function. * src/lisp.h (keys_of_casefiddle): * src/casefiddle.c (keys_of_casefiddle): Delete function. * src/emacs.c (main): Don't call them.
This commit is contained in:
parent
5bddc09738
commit
8ef4314c44
22
lisp/subr.el
22
lisp/subr.el
@ -1242,9 +1242,17 @@ in a cleaner way with command remapping, like this:
|
||||
;; global-map, esc-map, and ctl-x-map have their values set up in
|
||||
;; keymap.c; we just give them docstrings here.
|
||||
|
||||
(defvar esc-map nil
|
||||
(defvar esc-map
|
||||
(let ((map (make-keymap)))
|
||||
(define-key map "u" #'upcase-word)
|
||||
(define-key map "l" #'downcase-word)
|
||||
(define-key map "c" #'capitalize-word)
|
||||
(define-key map "x" #'execute-extended-command)
|
||||
map)
|
||||
"Default keymap for ESC (meta) commands.
|
||||
The normal global definition of the character ESC indirects to this keymap.")
|
||||
(fset 'ESC-prefix esc-map)
|
||||
(make-obsolete 'ESC-prefix 'esc-map "28.1")
|
||||
|
||||
(defvar ctl-x-4-map (make-sparse-keymap)
|
||||
"Keymap for subcommands of C-x 4.")
|
||||
@ -1273,7 +1281,7 @@ The normal global definition of the character ESC indirects to this keymap.")
|
||||
"Default keymap for C-x commands.
|
||||
The normal global definition of the character C-x indirects to this keymap.")
|
||||
(fset 'Control-X-prefix ctl-x-map)
|
||||
(make-obsolete 'Control-X-prefix 'ctl-x-map "28.1")
|
||||
(make-obsolete 'Control-X-prefix 'ctl-x-map "28.1")
|
||||
|
||||
(defvar global-map
|
||||
(let ((map (make-keymap)))
|
||||
@ -1296,10 +1304,16 @@ The normal global definition of the character C-x indirects to this keymap.")
|
||||
(define-key map "\C-b" #'backward-char)
|
||||
(define-key map "\C-e" #'end-of-line)
|
||||
(define-key map "\C-f" #'forward-char)
|
||||
|
||||
(define-key map "\C-z" #'suspend-emacs) ;FIXME: Re-bound later!
|
||||
(define-key map "\C-x\C-z" #'suspend-emacs) ;FIXME: Re-bound later!
|
||||
(define-key map "\C-v" #'scroll-up-command)
|
||||
(define-key map "\C-]" #'abort-recursive-edit)
|
||||
|
||||
(define-key map "\C-v" #'scroll-up-command)
|
||||
(define-key map "\M-v" #'scroll-down-command)
|
||||
(define-key map "\M-\C-v" #'scroll-other-window)
|
||||
|
||||
(define-key map "\M-\C-c" #'exit-recursive-edit)
|
||||
(define-key map "\C-]" #'abort-recursive-edit)
|
||||
map)
|
||||
"Default global keymap mapping Emacs keyboard input into commands.
|
||||
The value is a keymap that is usually (but not necessarily) Emacs's
|
||||
|
@ -682,11 +682,3 @@ Called with one argument METHOD which can be:
|
||||
defsubr (&Sdowncase_word);
|
||||
defsubr (&Scapitalize_word);
|
||||
}
|
||||
|
||||
void
|
||||
keys_of_casefiddle (void)
|
||||
{
|
||||
initial_define_key (meta_map, 'u', "upcase-word");
|
||||
initial_define_key (meta_map, 'l', "downcase-word");
|
||||
initial_define_key (meta_map, 'c', "capitalize-word");
|
||||
}
|
||||
|
@ -23,12 +23,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define Ctl(c) ((c)&037)
|
||||
|
||||
/* Define the names of keymaps, just so people can refer to them in
|
||||
calls to initial_define_key. These should *not* be used after
|
||||
initialization; use-global-map doesn't affect these; it sets
|
||||
current_global_map instead. */
|
||||
extern Lisp_Object meta_map;
|
||||
|
||||
/* If not Qnil, this is a switch-frame event which we decided to put
|
||||
off until the end of a key sequence. This should be read as the
|
||||
next command input, after any Vunread_command_events.
|
||||
|
@ -1956,9 +1956,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
|
||||
syms_of_json ();
|
||||
#endif
|
||||
|
||||
keys_of_casefiddle ();
|
||||
keys_of_keyboard ();
|
||||
keys_of_window ();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -12388,9 +12388,6 @@ syms_of_keyboard_for_pdumper (void)
|
||||
void
|
||||
keys_of_keyboard (void)
|
||||
{
|
||||
initial_define_key (meta_map, Ctl ('C'), "exit-recursive-edit");
|
||||
initial_define_key (meta_map, 'x', "execute-extended-command");
|
||||
|
||||
initial_define_lispy_key (Vspecial_event_map, "delete-frame",
|
||||
"handle-delete-frame");
|
||||
#ifdef HAVE_NTGUI
|
||||
|
28
src/keymap.c
28
src/keymap.c
@ -59,17 +59,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
Lisp_Object current_global_map; /* Current global keymap. */
|
||||
|
||||
Lisp_Object meta_map; /* The keymap used for globally bound
|
||||
ESC-prefixed default commands. */
|
||||
|
||||
/* The keymap used by the minibuf for local
|
||||
bindings when spaces are allowed in the
|
||||
minibuf. */
|
||||
|
||||
/* The keymap used by the minibuf for local
|
||||
bindings when spaces are not encouraged
|
||||
in the minibuf. */
|
||||
|
||||
/* Alist of elements like (DEL . "\d"). */
|
||||
static Lisp_Object exclude_keys;
|
||||
|
||||
@ -135,19 +124,6 @@ in case you use it as a menu with `x-popup-menu'. */)
|
||||
return list1 (Qkeymap);
|
||||
}
|
||||
|
||||
/* This function is used for installing the standard key bindings
|
||||
at initialization time.
|
||||
|
||||
For example:
|
||||
|
||||
initial_define_key (control_x_map, Ctl('X'), "exchange-point-and-mark"); */
|
||||
|
||||
void
|
||||
initial_define_key (Lisp_Object keymap, int key, const char *defname)
|
||||
{
|
||||
store_in_keymap (keymap, make_fixnum (key), intern_c_string (defname));
|
||||
}
|
||||
|
||||
void
|
||||
initial_define_lispy_key (Lisp_Object keymap, const char *keyname, const char *defname)
|
||||
{
|
||||
@ -3193,10 +3169,6 @@ syms_of_keymap (void)
|
||||
current_global_map = Qnil;
|
||||
staticpro (¤t_global_map);
|
||||
|
||||
meta_map = Fmake_keymap (Qnil);
|
||||
Fset (intern_c_string ("esc-map"), meta_map);
|
||||
Ffset (intern_c_string ("ESC-prefix"), meta_map);
|
||||
|
||||
exclude_keys = pure_list
|
||||
(pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")),
|
||||
pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")),
|
||||
|
@ -37,7 +37,6 @@ extern char *push_key_description (EMACS_INT, char *);
|
||||
extern Lisp_Object access_keymap (Lisp_Object, Lisp_Object, bool, bool, bool);
|
||||
extern Lisp_Object get_keymap (Lisp_Object, bool, bool);
|
||||
extern ptrdiff_t current_minor_maps (Lisp_Object **, Lisp_Object **);
|
||||
extern void initial_define_key (Lisp_Object, int, const char *);
|
||||
extern void initial_define_lispy_key (Lisp_Object, const char *, const char *);
|
||||
extern void syms_of_keymap (void);
|
||||
|
||||
|
@ -4357,7 +4357,6 @@ extern void syms_of_callint (void);
|
||||
/* Defined in casefiddle.c. */
|
||||
|
||||
extern void syms_of_casefiddle (void);
|
||||
extern void keys_of_casefiddle (void);
|
||||
|
||||
/* Defined in casetab.c. */
|
||||
|
||||
|
@ -8583,10 +8583,3 @@ displayed after a scrolling operation to be somewhat inaccurate. */);
|
||||
defsubr (&Swindow_parameter);
|
||||
defsubr (&Sset_window_parameter);
|
||||
}
|
||||
|
||||
void
|
||||
keys_of_window (void)
|
||||
{
|
||||
initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
|
||||
initial_define_key (meta_map, 'v', "scroll-down-command");
|
||||
}
|
||||
|
@ -1202,7 +1202,6 @@ extern bool window_outdated (struct window *);
|
||||
extern void init_window_once (void);
|
||||
extern void init_window (void);
|
||||
extern void syms_of_window (void);
|
||||
extern void keys_of_window (void);
|
||||
/* Move cursor to row/column position VPOS/HPOS, pixel coordinates
|
||||
Y/X. HPOS/VPOS are window-relative row and column numbers and X/Y
|
||||
are window-relative pixel positions. This is always done during
|
||||
|
Loading…
Reference in New Issue
Block a user