diff options
author | Richard M. Stallman <[email protected]> | 1994-12-15 01:56:13 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1994-12-15 01:56:13 +0000 |
commit | 487d5fb248c6640aa8d79eb58ec344c5ec2665ac (patch) | |
tree | d3d376731e5fddb9c6ca1967dae3a02282bd8f53 /lisp/apropos.el | |
parent | a42ba017bc22ce7714ecd981b25332f92cc02af0 (diff) |
(apropos-match-keys): Handle menu bindings with cached equivalent keys.
(apropos-match-keys): Handle minor mode maps
and overriding-local-map.
Diffstat (limited to 'lisp/apropos.el')
-rw-r--r-- | lisp/apropos.el | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el index 170a1defb8..bf5c5bcc45 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -243,9 +243,16 @@ Returns list of symbols and documentation found." (defun apropos-match-keys (alist &optional regexp) (let* ((current-local-map (current-local-map)) - (maps (append (and current-local-map - (accessible-keymaps current-local-map)) - (accessible-keymaps (current-global-map)))) + ;; Get a list of the top-level maps now active. + (top-maps + (if overriding-local-map + (list overriding-local-map (current-global-map)) + (append (current-minor-mode-maps) + (if current-local-map + (list current-local-map (current-global-map)) + (list (current-global-map)))))) + ;; Turn that into a list of all the maps including submaps. + (maps (apply 'append (mapcar 'accessible-keymaps top-maps))) map ;map we are now inspecting sequence ;key sequence to reach map i ;index into vector map @@ -263,12 +270,17 @@ Returns list of symbols and documentation found." (setq map (cdr map))) (while (stringp (car-safe map)) (setq map (cdr map))) + (while (consp map) (cond ((consp (car map)) (setq command (cdr (car map)) key (car (car map))) - ;; Skip any menu prompt in this key binding. - (and (consp command) (symbolp (cdr command)) + ;; Skip any menu prompt and help string in this key binding. + (while (and (consp command) (stringp (car command))) + (setq command (cdr command))) + ;; Skip any cached equivalent key. + (and (consp command) + (consp (car command)) (setq command (cdr command))) ;; if is a symbol, and matches optional regexp, and is a car ;; in alist, and is not shadowed by a different local binding, |