summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-04-20 20:51:11 +0000
committerRichard M. Stallman <rms@gnu.org>2004-04-20 20:51:11 +0000
commit19a151e59be99e7155a1d8f1fb4e7c5c6ca945fc (patch)
tree1430e50b9ff931393673987477ffd5f6b3dc4581 /lisp/help-fns.el
parentc78633461e9cd1835ebc474242cdbe2e46185c5b (diff)
downloademacs-19a151e59be99e7155a1d8f1fb4e7c5c6ca945fc.tar.gz
(describe-function-1): If many non-control non-meta
keys run the command, don't list all of them.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el21
1 files changed, 18 insertions, 3 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 000b8cb5e16..6a71a544638 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -355,16 +355,31 @@ KIND should be `var' for a variable or `subr' for a subroutine."
(when (commandp function)
(let* ((remapped (command-remapping function))
(keys (where-is-internal
- (or remapped function) overriding-local-map nil nil)))
+ (or remapped function) overriding-local-map nil nil))
+ non-modified-keys)
+ ;; Which non-control non-meta keys run this command?
+ (dolist (key keys)
+ (if (member (event-modifiers (aref key 0)) '(nil (shift)))
+ (push key non-modified-keys)))
(when remapped
(princ "It is remapped to `")
(princ (symbol-name remapped))
(princ "'"))
+
(when keys
(princ (if remapped " which is bound to " "It is bound to "))
;; FIXME: This list can be very long (f.ex. for self-insert-command).
- (princ (mapconcat 'key-description keys ", ")))
- (when (or remapped keys)
+ ;; If there are many, remove them from KEYS.
+ (if (< (length non-modified-keys) 10)
+ (princ (mapconcat 'key-description keys ", "))
+ (dolist (key non-modified-keys)
+ (setq keys (delq key keys)))
+ (if keys
+ (progn
+ (princ (mapconcat 'key-description keys ", "))
+ (princ ", and many ordinary text characters"))
+ (princ "many ordinary text characters"))))
+ (when (or remapped keys non-modified-keys)
(princ ".")
(terpri))))
(let* ((arglist (help-function-arglist def))