summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-06-05 21:48:21 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-06-05 21:48:21 +0200
commit3f388d7929346f39c99b7d801e8f62a9b71c4b73 (patch)
tree6a01828188a0167465f7621da73831fbd9a0a422 /lisp/help-fns.el
parentbb9c899b07a6a7de3a04b65caa55f11fdc36908c (diff)
downloademacs-3f388d7929346f39c99b7d801e8f62a9b71c4b73.tar.gz
Make `C-h f' look up key bindings in the current buffer again
* lisp/help-fns.el (describe-function): Pass in the correct buffer to look up key bindings in. (describe-function-1): Use it.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index f200077faec..8b4905aed15 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -259,6 +259,7 @@ handling of autoloaded functions."
(let ((describe-function-orig-buffer
(or describe-function-orig-buffer
(current-buffer)))
+ (key-buffer (current-buffer))
(help-buffer-under-preparation t))
(help-setup-xref
@@ -277,7 +278,7 @@ handling of autoloaded functions."
;; 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))))))
@@ -1025,7 +1026,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)."
(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
@@ -1047,7 +1048,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)."
(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.