summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2002-11-07 18:28:09 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2002-11-07 18:28:09 +0000
commit3829bcc589bf84c5b2f7327d8728c4f84840829b (patch)
treed96065fe694c0ca26c7b3958ef1dee29d59e4589
parentcd59ea72b2cfaa0b0610747e956cb7ff6bcb4b78 (diff)
downloademacs-3829bcc589bf84c5b2f7327d8728c4f84840829b.tar.gz
(where-is): Rename map to defs (a list of syms is not a map).
Test fboundp first, to speed things up. Use push.
-rw-r--r--lisp/help.el36
1 files changed, 16 insertions, 20 deletions
diff --git a/lisp/help.el b/lisp/help.el
index eb54aec958b..4002a0aee16 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -413,30 +413,26 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
(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 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
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)