* lisp/man.el (Man-getpage-in-background): Don't set buffer before display.
authorJuri Linkov <juri@linkov.net>
Fri, 31 May 2024 06:25:52 +0000 (09:25 +0300)
committerJuri Linkov <juri@linkov.net>
Fri, 31 May 2024 06:25:52 +0000 (09:25 +0300)
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).

lisp/man.el

index d96396483d393ec74b13aec5479f07acb59267fb..816c75d749c447ada988ec709bbb8040be331a2a 100644 (file)
@@ -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)