diff options
| -rw-r--r-- | lisp/help-fns.el | 21 |
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." | |||
| 355 | (when (commandp function) | 355 | (when (commandp function) |
| 356 | (let* ((remapped (command-remapping function)) | 356 | (let* ((remapped (command-remapping function)) |
| 357 | (keys (where-is-internal | 357 | (keys (where-is-internal |
| 358 | (or remapped function) overriding-local-map nil nil))) | 358 | (or remapped function) overriding-local-map nil nil)) |
| 359 | non-modified-keys) | ||
| 360 | ;; Which non-control non-meta keys run this command? | ||
| 361 | (dolist (key keys) | ||
| 362 | (if (member (event-modifiers (aref key 0)) '(nil (shift))) | ||
| 363 | (push key non-modified-keys))) | ||
| 359 | (when remapped | 364 | (when remapped |
| 360 | (princ "It is remapped to `") | 365 | (princ "It is remapped to `") |
| 361 | (princ (symbol-name remapped)) | 366 | (princ (symbol-name remapped)) |
| 362 | (princ "'")) | 367 | (princ "'")) |
| 368 | |||
| 363 | (when keys | 369 | (when keys |
| 364 | (princ (if remapped " which is bound to " "It is bound to ")) | 370 | (princ (if remapped " which is bound to " "It is bound to ")) |
| 365 | ;; FIXME: This list can be very long (f.ex. for self-insert-command). | 371 | ;; FIXME: This list can be very long (f.ex. for self-insert-command). |
| 366 | (princ (mapconcat 'key-description keys ", "))) | 372 | ;; If there are many, remove them from KEYS. |
| 367 | (when (or remapped keys) | 373 | (if (< (length non-modified-keys) 10) |
| 374 | (princ (mapconcat 'key-description keys ", ")) | ||
| 375 | (dolist (key non-modified-keys) | ||
| 376 | (setq keys (delq key keys))) | ||
| 377 | (if keys | ||
| 378 | (progn | ||
| 379 | (princ (mapconcat 'key-description keys ", ")) | ||
| 380 | (princ ", and many ordinary text characters")) | ||
| 381 | (princ "many ordinary text characters")))) | ||
| 382 | (when (or remapped keys non-modified-keys) | ||
| 368 | (princ ".") | 383 | (princ ".") |
| 369 | (terpri)))) | 384 | (terpri)))) |
| 370 | (let* ((arglist (help-function-arglist def)) | 385 | (let* ((arglist (help-function-arglist def)) |