(let ((describe-function-orig-buffer
(or describe-function-orig-buffer
(current-buffer)))
+ (key-buffer (current-buffer))
(help-buffer-under-preparation t))
(help-setup-xref
;; Use " is " instead of a colon so that
;; it is easier to get out the function name using forward-sexp.
(princ " is ")
- (describe-function-1 function)
+ (describe-function-1 function key-buffer)
(with-current-buffer standard-output
;; Return the text we displayed.
(buffer-string))))))
(unless (eq ?\n (char-before (1- (point)))) (insert "\n")))
;;;###autoload
-(defun describe-function-1 (function)
+(defun describe-function-1 (function &optional key-bindings-buffer)
(let ((pt1 (with-current-buffer standard-output (point))))
(help-fns-function-description-header function)
(with-current-buffer standard-output
(documentation function t)
;; E.g. an alias for a not yet defined function.
((invalid-function void-function) nil)))
- (key-bindings-buffer (current-buffer)))
+ (key-bindings-buffer (or key-bindings-buffer (current-buffer))))
;; If the function is autoloaded, and its docstring has
;; key substitution constructs, load the library.