From 46822e9c5e96147c068b324a545b530c4818097a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 5 Jun 2022 22:48:28 +0200 Subject: [PATCH] Fix key binding buffer issue in describe-function better * lisp/help-fns.el (describe-function): Revert previous change here. (describe-function-1): Just use describe-function-orig-buffer instead of the key-buffer binding -- this will also make the rendering results correct when hitting `g' and `l'. --- lisp/help-fns.el | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 8b4905aed15..0b496e635ed 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -258,9 +258,7 @@ handling of autoloaded functions." ;; calling that. (let ((describe-function-orig-buffer (or describe-function-orig-buffer - (current-buffer))) - (key-buffer (current-buffer)) - (help-buffer-under-preparation t)) + (current-buffer)))) (help-setup-xref (list (lambda (function buffer) @@ -278,7 +276,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 key-buffer) + (describe-function-1 function) (with-current-buffer standard-output ;; Return the text we displayed. (buffer-string)))))) @@ -1026,7 +1024,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 &optional key-bindings-buffer) +(defun describe-function-1 (function) (let ((pt1 (with-current-buffer standard-output (point)))) (help-fns-function-description-header function) (with-current-buffer standard-output @@ -1047,8 +1045,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." ;; for invalid functions i.s.o. signaling an error. (documentation function t) ;; E.g. an alias for a not yet defined function. - ((invalid-function void-function) nil))) - (key-bindings-buffer (or key-bindings-buffer (current-buffer)))) + ((invalid-function void-function) nil)))) ;; If the function is autoloaded, and its docstring has ;; key substitution constructs, load the library. @@ -1065,7 +1062,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (help-fns--signature function doc-raw (if (subrp def) (indirect-function real-def) real-def) - real-function key-bindings-buffer) + real-function describe-function-orig-buffer) ;; E.g. an alias for a not yet defined function. ((invalid-function void-function) doc-raw)))) (help-fns--ensure-empty-line) -- 2.39.2