728 |
call2 (fun, key, val); |
call2 (fun, key, val); |
729 |
} |
} |
730 |
|
|
731 |
DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 2, 0, |
DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 3, 0, |
732 |
doc: /* Call FUNCTION for every binding in KEYMAP. |
doc: /* Call FUNCTION for every binding in KEYMAP. |
733 |
FUNCTION is called with two arguments: the event and its binding. |
FUNCTION is called with two arguments: the event and its binding. |
734 |
If KEYMAP has a parent, the parent's bindings are included as well. |
If KEYMAP has a parent, the parent's bindings are included as well. |
735 |
This works recursively: if the parent has itself a parent, then the |
This works recursively: if the parent has itself a parent, then the |
736 |
grandparent's bindings are also included and so on. */) |
grandparent's bindings are also included and so on. |
737 |
(function, keymap) |
usage: (map-keymap FUNCTION KEYMAP) */) |
738 |
Lisp_Object function, keymap; |
(function, keymap, sort_first) |
739 |
|
Lisp_Object function, keymap, sort_first; |
740 |
{ |
{ |
741 |
if (INTEGERP (function)) |
if (INTEGERP (function)) |
742 |
/* We have to stop integers early since map_keymap gives them special |
/* We have to stop integers early since map_keymap gives them special |
743 |
significance. */ |
significance. */ |
744 |
Fsignal (Qinvalid_function, Fcons (function, Qnil)); |
Fsignal (Qinvalid_function, Fcons (function, Qnil)); |
745 |
|
if (! NILP (sort_first)) |
746 |
|
return call3 (intern ("map-keymap-internal"), function, keymap, Qt); |
747 |
|
|
748 |
map_keymap (keymap, map_keymap_call, function, NULL, 1); |
map_keymap (keymap, map_keymap_call, function, NULL, 1); |
749 |
return Qnil; |
return Qnil; |
750 |
} |
} |