aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJim Blandy1993-03-14 05:50:49 +0000
committerJim Blandy1993-03-14 05:50:49 +0000
commit3e6580d01d4ce6f5942254a5136f3741d78bd998 (patch)
tree33b0a201cf968f4176a0681034233027fd0b0eb3 /lisp
parent0b74cf8cd89b9daa48966d4e2ab10cf0f52dc1d7 (diff)
downloademacs-3e6580d01d4ce6f5942254a5136f3741d78bd998.tar.gz
emacs-3e6580d01d4ce6f5942254a5136f3741d78bd998.zip
*** empty log message ***
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/lucid.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/lucid.el b/lisp/emacs-lisp/lucid.el
index 36600f540b6..6412b0bc8f4 100644
--- a/lisp/emacs-lisp/lucid.el
+++ b/lisp/emacs-lisp/lucid.el
@@ -44,3 +44,20 @@
44 (if (eq (nth 2 plist) prop) 44 (if (eq (nth 2 plist) prop)
45 (setcdr (cdr plist) (nthcdr 4 plist))) 45 (setcdr (cdr plist) (nthcdr 4 plist)))
46 (setq plist (cdr (cdr plist)))))) 46 (setq plist (cdr (cdr plist))))))
47
48(defun map-keymap (function keymap)
49 "Call FUNCTION for every binding in KEYMAP.
50This includes bindings inherited from a parent keymap.
51FUNCTION receives two arguments each time it is called:
52the character (more generally, the event type) that is bound,
53and the binding it has."
54 (while (consp keymap)
55 (if (consp (car keymap))
56 (funcall function (car (car keymap)) (cdr (car keymap)))
57 (if (vectorp (car keymap))
58 (let ((i (length (car keymap)))
59 (vector (car keymap)))
60 (while (>= i 0)
61 (funcall function i (aref vector i))
62 (setq i (1- i))))))
63 (setq keymap (cdr keymap))))