aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorRichard M. Stallman2004-11-16 17:00:59 +0000
committerRichard M. Stallman2004-11-16 17:00:59 +0000
commit0ea6ae0a0c3dccd2277a7500163d0145aeb39d94 (patch)
tree313779f65fbb725809fa76b9f831377a1389c109 /src/keymap.c
parent6df7142943fd0c7928723cea5c0e17086e918a47 (diff)
downloademacs-0ea6ae0a0c3dccd2277a7500163d0145aeb39d94.tar.gz
emacs-0ea6ae0a0c3dccd2277a7500163d0145aeb39d94.zip
(Fmap_keymap): New arg SORT-FIRST. Use
map-keymap-internal to implement that.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/keymap.c b/src/keymap.c
index a0d5c3b5be5..4062ff34ee9 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -728,19 +728,23 @@ map_keymap_call (key, val, fun, dummy)
728 call2 (fun, key, val); 728 call2 (fun, key, val);
729} 729}
730 730
731DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 2, 0, 731DEFUN ("map-keymap", Fmap_keymap, Smap_keymap, 2, 3, 0,
732 doc: /* Call FUNCTION for every binding in KEYMAP. 732 doc: /* Call FUNCTION for every binding in KEYMAP.
733FUNCTION is called with two arguments: the event and its binding. 733FUNCTION is called with two arguments: the event and its binding.
734If KEYMAP has a parent, the parent's bindings are included as well. 734If KEYMAP has a parent, the parent's bindings are included as well.
735This works recursively: if the parent has itself a parent, then the 735This works recursively: if the parent has itself a parent, then the
736grandparent's bindings are also included and so on. */) 736grandparent's bindings are also included and so on.
737 (function, keymap) 737usage: (map-keymap FUNCTION KEYMAP) */)
738 Lisp_Object function, keymap; 738 (function, keymap, sort_first)
739 Lisp_Object function, keymap, sort_first;
739{ 740{
740 if (INTEGERP (function)) 741 if (INTEGERP (function))
741 /* We have to stop integers early since map_keymap gives them special 742 /* We have to stop integers early since map_keymap gives them special
742 significance. */ 743 significance. */
743 Fsignal (Qinvalid_function, Fcons (function, Qnil)); 744 Fsignal (Qinvalid_function, Fcons (function, Qnil));
745 if (! NILP (sort_first))
746 return call3 (intern ("map-keymap-internal"), function, keymap, Qt);
747
744 map_keymap (keymap, map_keymap_call, function, NULL, 1); 748 map_keymap (keymap, map_keymap_call, function, NULL, 1);
745 return Qnil; 749 return Qnil;
746} 750}