From: Kim F. Storm Date: Wed, 6 Feb 2002 23:05:03 +0000 (+0000) Subject: (describe-function-1): Report remapped commands. X-Git-Tag: ttn-vms-21-2-B4~16800 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d2ab11c5a7f07613269d07e8054218b159256251;p=emacs.git (describe-function-1): Report remapped commands. --- 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.