Fixes: bug#33881
Copyright-paperwork-exempt: yes
* lisp/progmodes/flymake.el (flymake-show-diagnostics-buffer):
Set flymake--diagnostics-buffer-source before reverting.
(target (or (get-buffer name)
(with-current-buffer (get-buffer-create name)
(flymake-diagnostics-buffer-mode)
- (setq flymake--diagnostics-buffer-source source)
(current-buffer)))))
(with-current-buffer target
+ (setq flymake--diagnostics-buffer-source source)
(revert-buffer)
(display-buffer (current-buffer)))))