;; global-map, esc-map, and ctl-x-map have their values set up in
;; keymap.c; we just give them docstrings here.
-(defvar global-map nil
- "Default global keymap mapping Emacs keyboard input into commands.
-The value is a keymap that is usually (but not necessarily) Emacs's
-global map.")
-
(defvar esc-map nil
"Default keymap for ESC (meta) commands.
The normal global definition of the character ESC indirects to this keymap.")
"Keymap for tab-bar related commands.")
(define-key ctl-x-map "t" tab-prefix-map)
+(defvar global-map
+ (let ((map (make-keymap)))
+ (define-key map "\C-[" 'ESC-prefix)
+ (define-key map "\C-x" 'Control-X-prefix)
+
+ (define-key map "\C-i" #'self-insert-command)
+ (let* ((vec1 (make-vector 1 nil))
+ (f (lambda (from to)
+ (while (< from to)
+ (aset vec1 0 from)
+ (define-key map vec1 #'self-insert-command)
+ (setq from (1+ from))))))
+ (funcall f #o040 #o0177)
+ (when (eq system-type 'ms-dos) ;FIXME: Why?
+ (funcall f #o0200 #o0240))
+ (funcall f #o0240 #o0400))
+
+ (define-key map "\C-a" #'beginning-of-line)
+ (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-v" #'scroll-up-command)
+ (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
+global map.")
+(use-global-map global-map)
+
\f
;;;; Event manipulation functions.
defsubr (&Sdelete_char);
defsubr (&Sself_insert_command);
}
-
-void
-keys_of_cmds (void)
-{
- int n;
-
- initial_define_key (global_map, Ctl ('I'), "self-insert-command");
- for (n = 040; n < 0177; n++)
- initial_define_key (global_map, n, "self-insert-command");
-#ifdef MSDOS
- for (n = 0200; n < 0240; n++)
- initial_define_key (global_map, n, "self-insert-command");
-#endif
- for (n = 0240; n < 0400; n++)
- initial_define_key (global_map, n, "self-insert-command");
-
- initial_define_key (global_map, Ctl ('A'), "beginning-of-line");
- initial_define_key (global_map, Ctl ('B'), "backward-char");
- initial_define_key (global_map, Ctl ('E'), "end-of-line");
- initial_define_key (global_map, Ctl ('F'), "forward-char");
-}
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 global_map;
extern Lisp_Object meta_map;
extern Lisp_Object control_x_map;
#endif
keys_of_casefiddle ();
- keys_of_cmds ();
keys_of_buffer ();
keys_of_keyboard ();
- keys_of_keymap ();
keys_of_window ();
}
else
void
keys_of_keyboard (void)
{
- initial_define_key (global_map, Ctl ('Z'), "suspend-emacs");
initial_define_key (control_x_map, Ctl ('Z'), "suspend-emacs");
initial_define_key (meta_map, Ctl ('C'), "exit-recursive-edit");
- initial_define_key (global_map, Ctl (']'), "abort-recursive-edit");
initial_define_key (meta_map, 'x', "execute-extended-command");
initial_define_lispy_key (Vspecial_event_map, "delete-frame",
Lisp_Object current_global_map; /* Current global keymap. */
-Lisp_Object global_map; /* Default global key bindings. */
-
Lisp_Object meta_map; /* The keymap used for globally bound
ESC-prefixed default commands. */
Each one is the value of a Lisp variable, and is also
pointed to by a C variable */
- global_map = Fmake_keymap (Qnil);
- Fset (intern_c_string ("global-map"), global_map);
-
- current_global_map = global_map;
- staticpro (&global_map);
+ current_global_map = Qnil;
staticpro (¤t_global_map);
meta_map = Fmake_keymap (Qnil);
defsubr (&Swhere_is_internal);
defsubr (&Sdescribe_buffer_bindings);
}
-
-void
-keys_of_keymap (void)
-{
- initial_define_key (global_map, 033, "ESC-prefix");
- initial_define_key (global_map, Ctl ('X'), "Control-X-prefix");
-}
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);
-extern void keys_of_keymap (void);
typedef void (*map_keymap_function_t)
(Lisp_Object key, Lisp_Object val, Lisp_Object args, void *data);
/* Defined in cmds.c */
extern void syms_of_cmds (void);
-extern void keys_of_cmds (void);
/* Defined in coding.c. */
extern Lisp_Object detect_coding_system (const unsigned char *, ptrdiff_t,
initial_define_key (control_x_map, '<', "scroll-left");
initial_define_key (control_x_map, '>', "scroll-right");
- initial_define_key (global_map, Ctl ('V'), "scroll-up-command");
initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
initial_define_key (meta_map, 'v', "scroll-down-command");
}