emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1f5fa1de7f 2/2: Make where-is correctly identify aliases


From: Lars Ingebrigtsen
Subject: master 1f5fa1de7f 2/2: Make where-is correctly identify aliases
Date: Fri, 28 Jan 2022 11:28:43 -0500 (EST)

branch: master
commit 1f5fa1de7fc2f23ebd7e68db219da4faee916a6f
Author: Sebastian Urban <mrsebastianurban@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make where-is correctly identify aliases
    
    * lisp/help.el (where-is): Make aliases correctly say which
    function is an alias for what (bug#37325).
---
 lisp/help.el | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/lisp/help.el b/lisp/help.el
index 983f39479c..eb024373e4 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."
              (if insert
                  (if (> (length keys) 0)
                      (if remapped
-                         (format "%s (%s) (remapped from %s)"
-                                 keys remapped symbol)
-                       (format "%s (%s)" keys symbol))
+                         (format "%s, remapped to %s (%s)"
+                                  symbol remapped keys)
+                       (format "%s (%s)" symbol keys))
                    (format "M-x %s RET" symbol))
                (if (> (length keys) 0)
                    (if remapped
-                       (format "%s is remapped to %s which is on %s"
-                               symbol remapped keys)
-                     (format "%s is on %s" symbol keys))
+                       (if (eq symbol (symbol-function definition))
+                           (format
+                             "%s, which is remapped to %s, which is on %s"
+                            symbol remapped keys)
+                         (format "%s is remapped to %s, which is on %s"
+                                 symbol remapped keys))
+                     (if (eq symbol (symbol-function definition))
+                         (format "%s, which is on %s" symbol keys)
+                       (format "%s is on %s" symbol keys)))
                  ;; If this is the command the user asked about,
                  ;; and it is not on any key, say so.
                  ;; 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."
                      (format "%s is not on any key" symbol)))))
        (when string
          (unless (eq symbol definition)
-           (princ ";\n its alias "))
+           (if (eq definition (symbol-function symbol))
+               (princ ";\n its alias ")
+             (princ ";\n it's an alias for ")))
          (princ string)))))
   nil)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]