Mercurial > emacs
changeset 55009:10f2535aa14e
(describe-function-1): If many non-control non-meta
keys run the command, don't list all of them.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 20 Apr 2004 20:51:11 +0000 |
parents | f5cafaedbab0 |
children | 734c2a20e3ec |
files | lisp/help-fns.el |
diffstat | 1 files changed, 18 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/help-fns.el Tue Apr 20 20:40:41 2004 +0000 +++ b/lisp/help-fns.el Tue Apr 20 20:51:11 2004 +0000 @@ -355,16 +355,31 @@ (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))