]> git.eshelyaron.com Git - emacs.git/commitdiff
* 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)
committerEshel Yaron <me@eshelyaron.com>
Sat, 1 Jun 2024 17:04:58 +0000 (19:04 +0200)
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

index 6f5a8094aa3594c0eed753d44ad125565db4fd72..7bc90f6fc8296cd0d9bf901e81c02bdbfa8dc434 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)