{
CHECK_IMPURE (prev);
XSETCDR (prev, parent);
- RETURN_UNGCPRO (parent);
+ return parent;
}
prev = list;
}
length = XFASTINT (Flength (key));
if (length == 0)
- RETURN_UNGCPRO (Qnil);
+ return Qnil;
if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
message_with_string ("Key sequence contains invalid event %s", c, 1);
if (idx == length)
- RETURN_UNGCPRO (store_in_keymap (keymap, c, def));
+ return store_in_keymap (keymap, c, def);
cmd = access_keymap (keymap, c, 0, 1, 1);
length = XFASTINT (Flength (key));
if (length == 0)
- RETURN_UNGCPRO (keymap);
+ return keymap;
idx = 0;
while (1)
cmd = access_keymap (keymap, c, t_ok, 0, 1);
if (idx == length)
- RETURN_UNGCPRO (cmd);
+ return cmd;
keymap = get_keymap (cmd, 0, 1);
if (!CONSP (keymap))
- RETURN_UNGCPRO (make_number (idx));
+ return make_number (idx);
QUIT;
}
c = reorder_modifiers (c);
keystring = concat2 (build_string (new_mods), XCDR (assoc));
- error ((modifiers & ~meta_modifier
- ? "To bind the key %s, use [?%s], not [%s]"
- : "To bind the key %s, use \"%s\", not [%s]"),
+ error ("To bind the key %s, use [?%s], not [%s]",
SDATA (SYMBOL_NAME (c)), SDATA (keystring),
SDATA (SYMBOL_NAME (c)));
}
/* Use malloc here. See the comment above this function.
Avoid realloc here; it causes spurious traps on GNU/Linux [KFS] */
block_input ();
- newmodes = malloc (allocsize);
+ newmodes = xmalloc_unsafe (allocsize);
if (newmodes)
{
if (cmm_modes)
{
memcpy (newmodes, cmm_modes,
cmm_size * sizeof cmm_modes[0]);
- free (cmm_modes);
+ xfree (cmm_modes);
}
cmm_modes = newmodes;
}
- newmaps = malloc (allocsize);
+ newmaps = xmalloc_unsafe (allocsize);
if (newmaps)
{
if (cmm_maps)
{
memcpy (newmaps, cmm_maps,
cmm_size * sizeof cmm_maps[0]);
- free (cmm_maps);
+ xfree (cmm_maps);
}
cmm_maps = newmaps;
}
like in the respective argument of `key-binding'. */)
(Lisp_Object olp, Lisp_Object position)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
Lisp_Object keymaps = list1 (current_global_map);
keymaps = Fcons (otlp, keymaps);
}
- unbind_to (count, Qnil);
+ dynwind_end ();
return keymaps;
}
if (KEYMAPP (binding))
maps[j++] = Fcons (modes[i], binding);
else if (j == 0)
- RETURN_UNGCPRO (list1 (Fcons (modes[i], binding)));
+ return list1 (Fcons (modes[i], binding));
}
UNGCPRO;
/* We have a list of advertised bindings. */
while (CONSP (tem))
if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition))
- RETURN_UNGCPRO (XCAR (tem));
+ return XCAR (tem);
else
tem = XCDR (tem);
if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition))
- RETURN_UNGCPRO (tem);
+ return tem;
}
sequences = Freverse (where_is_internal (definition, keymaps,
nil, then we should return the first ascii-only binding
we find. */
if (EQ (firstonly, Qnon_ascii))
- RETURN_UNGCPRO (sequence);
+ return sequence;
else if (!NILP (firstonly)
&& 2 == preferred_sequence_p (sequence))
- RETURN_UNGCPRO (sequence);
+ return sequence;
}
UNGCPRO;
DESCRIBER is the output function used; nil means use `princ'. */)
(Lisp_Object vector, Lisp_Object describer)
{
- ptrdiff_t count = SPECPDL_INDEX ();
+ dynwind_begin ();
if (NILP (describer))
describer = intern ("princ");
specbind (Qstandard_output, Fcurrent_buffer ());
describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
Qnil, Qnil, 0, 0);
- return unbind_to (count, Qnil);
+ dynwind_end ();
+ return Qnil;
}
/* Insert in the current buffer a description of the contents of VECTOR.
void
syms_of_keymap (void)
{
+#include "keymap.x"
+
DEFSYM (Qkeymap, "keymap");
staticpro (&apropos_predicate);
staticpro (&apropos_accumulate);
where_is_cache = Qnil;
staticpro (&where_is_cache);
staticpro (&where_is_cache_keymaps);
-
- defsubr (&Skeymapp);
- defsubr (&Skeymap_parent);
- defsubr (&Skeymap_prompt);
- defsubr (&Sset_keymap_parent);
- defsubr (&Smake_keymap);
- defsubr (&Smake_sparse_keymap);
- defsubr (&Smap_keymap_internal);
- defsubr (&Smap_keymap);
- defsubr (&Scopy_keymap);
- defsubr (&Scommand_remapping);
- defsubr (&Skey_binding);
- defsubr (&Slocal_key_binding);
- defsubr (&Sglobal_key_binding);
- defsubr (&Sminor_mode_key_binding);
- defsubr (&Sdefine_key);
- defsubr (&Slookup_key);
- defsubr (&Sdefine_prefix_command);
- defsubr (&Suse_global_map);
- defsubr (&Suse_local_map);
- defsubr (&Scurrent_local_map);
- defsubr (&Scurrent_global_map);
- defsubr (&Scurrent_minor_mode_maps);
- defsubr (&Scurrent_active_maps);
- defsubr (&Saccessible_keymaps);
- defsubr (&Skey_description);
- defsubr (&Sdescribe_vector);
- defsubr (&Ssingle_key_description);
- defsubr (&Stext_char_description);
- defsubr (&Swhere_is_internal);
- defsubr (&Sdescribe_buffer_bindings);
- defsubr (&Sapropos_internal);
}
void