[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/keymap.c
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/src/keymap.c |
Date: |
Fri, 28 Dec 2001 13:39:05 -0500 |
Index: emacs/src/keymap.c
diff -c emacs/src/keymap.c:1.250 emacs/src/keymap.c:1.251
*** emacs/src/keymap.c:1.250 Thu Dec 20 13:26:10 2001
--- emacs/src/keymap.c Fri Dec 28 13:39:04 2001
***************
*** 48,53 ****
--- 48,56 ----
Lisp_Object control_x_map; /* The keymap used for globally bound
C-x-prefixed default commands */
+ /* Alist of elements like (DEL . "\d"). */
+ Lisp_Object exclude_keys;
+
/* was MinibufLocalMap */
Lisp_Object Vminibuffer_local_map;
/* The keymap used by the minibuf for local
***************
*** 1008,1013 ****
--- 1011,1022 ----
if (CONSP (c) && lucid_event_type_list_p (c))
c = Fevent_convert_list (c);
+ if (SYMBOLP (c) && ! NILP (Fassoc (Fsymbol_name (c), exclude_keys)))
+ error ("To bind the key %s, use; use \"%s\", not [%s]",
+ XSYMBOL (c)->name->data,
+ XSTRING (XCDR (Fassoc (Fsymbol_name (c), exclude_keys)))->data,
+ XSYMBOL (c)->name->data);
+
if (INTEGERP (c)
&& (XINT (c) & meta_bit)
&& !metized)
***************
*** 1025,1031 ****
}
if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c))
! error ("Key sequence contains invalid events");
if (idx == length)
RETURN_UNGCPRO (store_in_keymap (keymap, c, def));
--- 1034,1040 ----
}
if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c))
! error ("Key sequence contains invalid event");
if (idx == length)
RETURN_UNGCPRO (store_in_keymap (keymap, c, def));
***************
*** 1098,1103 ****
--- 1107,1115 ----
if (XINT (c) & 0x80 && STRINGP (key))
XSETINT (c, (XINT (c) | meta_modifier) & ~0x80);
+ if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c))
+ error ("Key sequence contains invalid event");
+
cmd = access_keymap (keymap, c, t_ok, 0, 1);
if (idx == length)
RETURN_UNGCPRO (cmd);
***************
*** 3369,3374 ****
--- 3381,3395 ----
control_x_map = Fmake_keymap (Qnil);
Fset (intern ("ctl-x-map"), control_x_map);
Ffset (intern ("Control-X-prefix"), control_x_map);
+
+ exclude_keys
+ = Fcons (Fcons (build_string ("DEL"), build_string ("\\d")),
+ Fcons (Fcons (build_string ("TAB"), build_string ("\\t")),
+ Fcons (Fcons (build_string ("RET"), build_string ("\\r")),
+ Fcons (Fcons (build_string ("ESC"), build_string
("\\e")),
+ Fcons (Fcons (build_string ("SPC"),
build_string (" ")),
+ Qnil)))));
+ staticpro (&exclude_keys);
DEFVAR_LISP ("define-key-rebound-commands", &Vdefine_key_rebound_commands,
doc: /* List of commands given new key bindings recently.