struct gcpro gcpro1, gcpro2, gcpro3;
Lisp_Object tail;
+ tail = Qnil;
GCPRO3 (map, args, tail);
map = get_keymap (map, 1, autoload);
for (tail = (CONSP (map) && EQ (Qkeymap, XCAR (map))) ? XCDR (map) : map;
store_in_keymap (keymap, idx, def)
Lisp_Object keymap;
register Lisp_Object idx;
- register Lisp_Object def;
+ Lisp_Object def;
{
/* Flush any reverse-map cache. */
where_is_cache = Qnil;
if (!CONSP (keymap))
/* We must use Fkey_description rather than just passing key to
error; key might be a vector, not a string. */
- error ("Key sequence %s uses invalid prefix characters",
- SDATA (Fkey_description (key, Qnil)));
+ error ("Key sequence %s starts with non-prefix key %s",
+ SDATA (Fkey_description (key, Qnil)),
+ SDATA (Fkey_description (Fsubstring (key, make_number (0),
+ make_number (idx)),
+ Qnil)));
}
}
int force_multibyte;
{
unsigned c2;
+ int valid_p;
/* Clear all the meaningless bits above the meta bit. */
c &= meta_modifier | ~ - meta_modifier;
c2 = c & ~(alt_modifier | ctrl_modifier | hyper_modifier
| meta_modifier | shift_modifier | super_modifier);
+ valid_p = SINGLE_BYTE_CHAR_P (c2) || char_valid_p (c2, 0);
+ if (! valid_p)
+ {
+ /* KEY_DESCRIPTION_SIZE is large enough for this. */
+ p += sprintf (p, "[%d]", c);
+ return p;
+ }
+
if (c & alt_modifier)
{
*p++ = 'A';
}
else
{
- int valid_p = SINGLE_BYTE_CHAR_P (c) || char_valid_p (c, 0);
-
- if (force_multibyte && valid_p)
+ if (force_multibyte)
{
if (SINGLE_BYTE_CHAR_P (c))
c = unibyte_char_to_multibyte (c);
p += CHAR_STRING (c, p);
}
- else if (NILP (current_buffer->enable_multibyte_characters)
- || valid_p)
+ else if (NILP (current_buffer->enable_multibyte_characters))
{
int bit_offset;
*p++ = '\\';
tem = shadow_lookup (shadow, kludge, Qt);
if (!NILP (tem))
{
- if (mention_shadow)
+ /* Avoid generating duplicate entries if the
+ shadowed binding has the same definition. */
+ if (mention_shadow && !EQ (tem, definition))
this_shadowed = 1;
else
continue;
if (INTEGERP (vect[i].event))
{
while (i + 1 < slots_used
- && XINT (vect[i + 1].event) == XINT (vect[i].event) + 1
+ && EQ (vect[i+1].event, make_number (XINT (vect[i].event) + 1))
&& !NILP (Fequal (vect[i + 1].definition, definition))
&& vect[i].shadowed == vect[i + 1].shadowed)
i++;
if (vect[i].shadowed)
{
SET_PT (PT - 1);
- insert_string (" (shadowed)");
+ insert_string ("\n (that binding is currently shadowed by another mode)");
SET_PT (PT + 1);
}
}