]> git.eshelyaron.com Git - emacs.git/commitdiff
(where-is): Repport also aliases of the passed command.
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 7 Nov 2002 16:46:11 +0000 (16:46 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 7 Nov 2002 16:46:11 +0000 (16:46 +0000)
lisp/ChangeLog
lisp/help.el

index 9982b43a38c20efa4027c55a7ab58835188d379d..e61a88947808c22d1116456f0675ba3a146e24ee 100644 (file)
@@ -1,3 +1,7 @@
+2002-11-07  Juanma Barranquero  <lektu@terra.es>
+
+       * help.el (where-is): Repport also aliases of the passed command.
+
 2002-11-07   Markus Rost  <rost@math.ohio-state.edu>
 
        * cus-dep.el (custom-make-dependencies): Fix comment inserted in
index 713dd6dfa23d3a34714511997ff9cf2514a3d1e1..eb54aec958bcc2d3342d72393dc3a8825e1f4a50 100644 (file)
@@ -420,21 +420,38 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
      (list (if (equal val "")
               fn (intern val))
           current-prefix-arg)))
-  (let* ((remapped (remap-command definition))
-        (keys (where-is-internal definition overriding-local-map nil nil remapped))
-        (keys1 (mapconcat 'key-description keys ", "))
-        (standard-output (if insert (current-buffer) t)))
-    (if insert
-       (if (> (length keys1) 0)
-           (if remapped
-               (princ (format "%s (%s) (remapped from %s)" keys1 remapped definition))
-             (princ (format "%s (%s)" keys1 definition)))
-         (princ (format "M-x %s RET" definition)))
-      (if (> (length keys1) 0)
-         (if remapped
-             (princ (format "%s is remapped to %s which is on %s" definition remapped keys1))
-           (princ (format "%s is on %s" definition keys1)))
-       (princ (format "%s is not on any key" definition)))))
+  (let ((func (indirect-function definition))
+        (map nil)
+        (standard-output (if insert (current-buffer) t)))
+    (mapatoms #'(lambda (symbol)
+                  (when (and (not (eq symbol definition))
+                             (fboundp symbol)
+                             (eq func (indirect-function symbol)))
+                    (setq map (cons symbol map)))))
+    (princ (mapconcat
+            #'(lambda (symbol)
+                (let* ((remapped (remap-command symbol))
+                       (keys (mapconcat 'key-description
+                                        (where-is-internal symbol
+                                                           overriding-local-map
+                                                           nil nil
+                                                           remapped)
+                                        ", ")))
+                  (if insert
+                      (if (> (length keys) 0)
+                          (if remapped
+                              (format "%s (%s) (remapped from %s)"
+                                      keys remapped symbol)
+                            (format "%s (%s)" keys symbol))
+                        (format "M-x %s RET" symbol))
+                    (if (> (length keys) 0)
+                        (if remapped
+                            (format "%s is remapped to %s which is on %s"
+                                    definition symbol keys)
+                          (format "%s is on %s" symbol keys))
+                      (format "%s is not on any key" symbol)))))
+            (cons definition map)
+            ";\nand ")))
   nil)
 
 (defun string-key-binding (key)