From 1838ecb16592ab4b3a2af4fca6874f92d84e2860 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 31 May 2024 09:25:52 +0300 Subject: [PATCH] * lisp/man.el (Man-getpage-in-background): Don't set buffer before display. Call 'Man-notify-when-ready' before switching the current buffer. This will avoid possible messing with the current buffer by 'Man-notify-when-ready' where display-buffer functions might change the current buffer, thus breaking the subsequent setting of buffer-local variables like Man-arguments in the wrong buffer (bug#71271). (cherry picked from commit b7824916300e63e7352d2e268c72894b68937553) --- lisp/man.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/man.el b/lisp/man.el index 6f5a8094aa3..7bc90f6fc82 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1202,8 +1202,8 @@ Return the buffer in which the manpage will appear." (Man-notify-when-ready buffer) (message "Invoking %s %s in the background" manual-program man-args) (setq buffer (generate-new-buffer bufname)) + (Man-notify-when-ready buffer) (with-current-buffer buffer - (Man-notify-when-ready buffer) (setq buffer-undo-list t) (setq Man-original-frame (selected-frame)) (setq Man-arguments man-args) -- 2.39.2