From d2ab11c5a7f07613269d07e8054218b159256251 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Wed, 6 Feb 2002 23:05:03 +0000 Subject: [PATCH] (describe-function-1): Report remapped commands. --- lisp/help-fns.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index a158ddf64fe..20d76f9c913 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -207,12 +207,20 @@ and the file name is displayed in the echo area." (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. -- 2.39.2