1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00

Don't overwrite variables set by callback in help--window-setup

* lisp/help.el (help--window-setup): Initialize the buffer in the
correct order to avoid resetting variables set by the callback.
This commit is contained in:
Lars Ingebrigtsen 2022-05-13 17:14:21 +02:00
parent cd87a5c7a1
commit bd464297bd

View File

@ -1954,8 +1954,11 @@ The `temp-buffer-window-setup-hook' hook is called."
;; where this should be set to a buffer position is within BODY.
(set-marker help-window-point-marker nil)
(with-current-buffer (get-buffer-create buffer)
(unless (derived-mode-p 'help-mode)
(help-mode))
(setq buffer-read-only t
buffer-file-name nil)
(setq-local help-mode--current-data nil)
(buffer-disable-undo)
(let ((inhibit-read-only t)
(inhibit-modification-hooks t))
@ -1966,8 +1969,6 @@ The `temp-buffer-window-setup-hook' hook is called."
(funcall callback)
(run-hooks 'temp-buffer-window-setup-hook))
(help-window-setup (temp-buffer-window-show (current-buffer)))
(unless (derived-mode-p 'help-mode)
(help-mode))
(help-make-xrefs (current-buffer))))))
;; Called from C, on encountering `help-char' when reading a char.