aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-12-15 01:56:13 +0000
committerRichard M. Stallman1994-12-15 01:56:13 +0000
commit487d5fb248c6640aa8d79eb58ec344c5ec2665ac (patch)
treed3d376731e5fddb9c6ca1967dae3a02282bd8f53
parenta42ba017bc22ce7714ecd981b25332f92cc02af0 (diff)
downloademacs-487d5fb248c6640aa8d79eb58ec344c5ec2665ac.tar.gz
emacs-487d5fb248c6640aa8d79eb58ec344c5ec2665ac.zip
(apropos-match-keys): Handle menu bindings with cached equivalent keys.
(apropos-match-keys): Handle minor mode maps and overriding-local-map.
-rw-r--r--lisp/apropos.el22
1 files changed, 17 insertions, 5 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 170a1defb81..bf5c5bcc453 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -243,9 +243,16 @@ Returns list of symbols and documentation found."
243 243
244(defun apropos-match-keys (alist &optional regexp) 244(defun apropos-match-keys (alist &optional regexp)
245 (let* ((current-local-map (current-local-map)) 245 (let* ((current-local-map (current-local-map))
246 (maps (append (and current-local-map 246 ;; Get a list of the top-level maps now active.
247 (accessible-keymaps current-local-map)) 247 (top-maps
248 (accessible-keymaps (current-global-map)))) 248 (if overriding-local-map
249 (list overriding-local-map (current-global-map))
250 (append (current-minor-mode-maps)
251 (if current-local-map
252 (list current-local-map (current-global-map))
253 (list (current-global-map))))))
254 ;; Turn that into a list of all the maps including submaps.
255 (maps (apply 'append (mapcar 'accessible-keymaps top-maps)))
249 map ;map we are now inspecting 256 map ;map we are now inspecting
250 sequence ;key sequence to reach map 257 sequence ;key sequence to reach map
251 i ;index into vector map 258 i ;index into vector map
@@ -263,12 +270,17 @@ Returns list of symbols and documentation found."
263 (setq map (cdr map))) 270 (setq map (cdr map)))
264 (while (stringp (car-safe map)) 271 (while (stringp (car-safe map))
265 (setq map (cdr map))) 272 (setq map (cdr map)))
273
266 (while (consp map) 274 (while (consp map)
267 (cond ((consp (car map)) 275 (cond ((consp (car map))
268 (setq command (cdr (car map)) 276 (setq command (cdr (car map))
269 key (car (car map))) 277 key (car (car map)))
270 ;; Skip any menu prompt in this key binding. 278 ;; Skip any menu prompt and help string in this key binding.
271 (and (consp command) (symbolp (cdr command)) 279 (while (and (consp command) (stringp (car command)))
280 (setq command (cdr command)))
281 ;; Skip any cached equivalent key.
282 (and (consp command)
283 (consp (car command))
272 (setq command (cdr command))) 284 (setq command (cdr command)))
273 ;; if is a symbol, and matches optional regexp, and is a car 285 ;; if is a symbol, and matches optional regexp, and is a car
274 ;; in alist, and is not shadowed by a different local binding, 286 ;; in alist, and is not shadowed by a different local binding,