comparison lisp/help-fns.el @ 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 668b6361c3c4
children 5f7255c11791
comparison
equal deleted inserted replaced
43156:05398ea6cb32 43157:c72ba425c038
205 (re-search-backward "`\\([^`']+\\)'" nil t) 205 (re-search-backward "`\\([^`']+\\)'" nil t)
206 (help-xref-button 1 'help-function-def function file-name))))) 206 (help-xref-button 1 'help-function-def function file-name)))))
207 (princ ".") 207 (princ ".")
208 (terpri) 208 (terpri)
209 (when (commandp function) 209 (when (commandp function)
210 (let ((keys (where-is-internal 210 (let* ((binding (and (symbolp function) (commandp function)
211 function overriding-local-map nil nil))) 211 (key-binding function nil t)))
212 (remapped (and (symbolp binding) (commandp binding) binding))
213 (keys (where-is-internal
214 (or remapped function) overriding-local-map nil nil)))
215 (when remapped
216 (princ "It is remapped to `")
217 (princ (symbol-name remapped))
218 (princ "'"))
212 (when keys 219 (when keys
213 (princ "It is bound to ") 220 (princ (if remapped " which is bound to " "It is bound to "))
214 ;; FIXME: This list can be very long (f.ex. for self-insert-command). 221 ;; FIXME: This list can be very long (f.ex. for self-insert-command).
215 (princ (mapconcat 'key-description keys ", ")) 222 (princ (mapconcat 'key-description keys ", ")))
223 (when (or remapped keys)
216 (princ ".") 224 (princ ".")
217 (terpri)))) 225 (terpri))))
218 ;; Handle symbols aliased to other symbols. 226 ;; Handle symbols aliased to other symbols.
219 (setq def (indirect-function def)) 227 (setq def (indirect-function def))
220 ;; If definition is a macro, find the function inside it. 228 ;; If definition is a macro, find the function inside it.