[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master bd464297bd 2/2: Don't overwrite variables set by callback in help
From: |
Lars Ingebrigtsen |
Subject: |
master bd464297bd 2/2: Don't overwrite variables set by callback in help--window-setup |
Date: |
Fri, 13 May 2022 11:14:42 -0400 (EDT) |
branch: master
commit bd464297bde2357bbcc96773355ae439fb567b31
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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.
---
lisp/help.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/help.el b/lisp/help.el
index 83782a8477..8727b60bfd 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -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.