changeset 43157:c72ba425c038

(describe-function-1): Report remapped commands.
author Kim F. Storm <storm@cua.dk>
date Wed, 06 Feb 2002 23:05:03 +0000
parents 05398ea6cb32
children 43607fa60102
files lisp/help-fns.el
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/help-fns.el	Wed Feb 06 23:03:56 2002 +0000
+++ b/lisp/help-fns.el	Wed Feb 06 23:05:03 2002 +0000
@@ -207,12 +207,20 @@
     (princ ".")
     (terpri)
     (when (commandp function)
-      (let ((keys (where-is-internal
-		   function overriding-local-map nil nil)))
+      (let* ((binding (and (symbolp function) (commandp function)
+			   (key-binding function nil t)))
+	     (remapped (and (symbolp binding) (commandp binding) binding))
+	     (keys (where-is-internal
+		   (or remapped function) overriding-local-map nil nil)))
+	(when remapped
+	  (princ "It is remapped to `")
+	  (princ (symbol-name remapped))
+	  (princ "'"))
 	(when keys
-	  (princ "It is bound to ")
+	  (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 ", "))
+	  (princ (mapconcat 'key-description keys ", ")))
+	(when (or remapped keys)
 	  (princ ".")
 	  (terpri))))
     ;; Handle symbols aliased to other symbols.