# HG changeset patch # User Stefan Monnier # Date 1036693689 0 # Node ID 50c0685806fbaa137f2b891c0a2bbb771aa3ac5e # Parent f233dc0ca0aa92a392a1a037c6d8059b99383c79 (where-is): Rename map to defs (a list of syms is not a map). Test fboundp first, to speed things up. Use push. diff -r f233dc0ca0aa -r 50c0685806fb lisp/help.el --- a/lisp/help.el Thu Nov 07 17:46:04 2002 +0000 +++ b/lisp/help.el Thu Nov 07 18:28:09 2002 +0000 @@ -413,30 +413,26 @@ (let ((fn (function-called-at-point)) (enable-recursive-minibuffers t) val) - (setq val (completing-read (if fn - (format "Where is command (default %s): " fn) - "Where is command: ") - obarray 'commandp t)) - (list (if (equal val "") - fn (intern val)) - current-prefix-arg))) + (setq val (completing-read + (if fn + (format "Where is command (default %s): " fn) + "Where is command: ") + obarray 'commandp t)) + (list (if (equal val "") fn (intern val)) current-prefix-arg))) (let ((func (indirect-function definition)) - (map nil) + (defs nil) (standard-output (if insert (current-buffer) t))) - (mapatoms #'(lambda (symbol) - (when (and (not (eq symbol definition)) - (fboundp symbol) - (eq func (indirect-function symbol))) - (setq map (cons symbol map))))) + (mapatoms (lambda (symbol) + (and (fboundp symbol) + (not (eq symbol definition)) + (eq func (indirect-function symbol)) + (push symbol defs)))) (princ (mapconcat #'(lambda (symbol) (let* ((remapped (remap-command symbol)) - (keys (mapconcat 'key-description - (where-is-internal symbol - overriding-local-map - nil nil - remapped) - ", "))) + (keys (where-is-internal + symbol overriding-local-map nil nil remapped)) + (keys (mapconcat 'key-description keys ", "))) (if insert (if (> (length keys) 0) (if remapped @@ -450,7 +446,7 @@ definition symbol keys) (format "%s is on %s" symbol keys)) (format "%s is not on any key" symbol))))) - (cons definition map) + (cons definition defs) ";\nand "))) nil)