diff options
| author | Sebastian Urban | 2022-01-28 17:27:28 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-01-28 17:27:28 +0100 |
| commit | 1f5fa1de7fc2f23ebd7e68db219da4faee916a6f (patch) | |
| tree | da450b5f472fba6a8613cb783dc44f616e5de240 | |
| parent | 96867f9d0897319adda9d7b8ec84c1fb9e451225 (diff) | |
| download | emacs-1f5fa1de7fc2f23ebd7e68db219da4faee916a6f.tar.gz emacs-1f5fa1de7fc2f23ebd7e68db219da4faee916a6f.zip | |
Make where-is correctly identify aliases
* lisp/help.el (where-is): Make aliases correctly say which
function is an alias for what (bug#37325).
| -rw-r--r-- | lisp/help.el | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lisp/help.el b/lisp/help.el index 983f39479cb..eb024373e45 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -650,15 +650,21 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer." | |||
| 650 | (if insert | 650 | (if insert |
| 651 | (if (> (length keys) 0) | 651 | (if (> (length keys) 0) |
| 652 | (if remapped | 652 | (if remapped |
| 653 | (format "%s (%s) (remapped from %s)" | 653 | (format "%s, remapped to %s (%s)" |
| 654 | keys remapped symbol) | 654 | symbol remapped keys) |
| 655 | (format "%s (%s)" keys symbol)) | 655 | (format "%s (%s)" symbol keys)) |
| 656 | (format "M-x %s RET" symbol)) | 656 | (format "M-x %s RET" symbol)) |
| 657 | (if (> (length keys) 0) | 657 | (if (> (length keys) 0) |
| 658 | (if remapped | 658 | (if remapped |
| 659 | (format "%s is remapped to %s which is on %s" | 659 | (if (eq symbol (symbol-function definition)) |
| 660 | symbol remapped keys) | 660 | (format |
| 661 | (format "%s is on %s" symbol keys)) | 661 | "%s, which is remapped to %s, which is on %s" |
| 662 | symbol remapped keys) | ||
| 663 | (format "%s is remapped to %s, which is on %s" | ||
| 664 | symbol remapped keys)) | ||
| 665 | (if (eq symbol (symbol-function definition)) | ||
| 666 | (format "%s, which is on %s" symbol keys) | ||
| 667 | (format "%s is on %s" symbol keys))) | ||
| 662 | ;; If this is the command the user asked about, | 668 | ;; If this is the command the user asked about, |
| 663 | ;; and it is not on any key, say so. | 669 | ;; and it is not on any key, say so. |
| 664 | ;; For other symbols, its aliases, say nothing | 670 | ;; For other symbols, its aliases, say nothing |
| @@ -667,7 +673,9 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer." | |||
| 667 | (format "%s is not on any key" symbol))))) | 673 | (format "%s is not on any key" symbol))))) |
| 668 | (when string | 674 | (when string |
| 669 | (unless (eq symbol definition) | 675 | (unless (eq symbol definition) |
| 670 | (princ ";\n its alias ")) | 676 | (if (eq definition (symbol-function symbol)) |
| 677 | (princ ";\n its alias ") | ||
| 678 | (princ ";\n it's an alias for "))) | ||
| 671 | (princ string))))) | 679 | (princ string))))) |
| 672 | nil) | 680 | nil) |
| 673 | 681 | ||