Subject: Re: bug#33881: 27.0.50; flymake-show-diagnostics-buffer throwing 'Selecting deleted buffer' error
From: João Távora <[email-masked]>
To: John Shahid <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 05 Jan 2019 11:44:00 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

John Shahid <[email-masked]> writes:

> I was able to fix the issue by applying the following patch
>
> From 2dda8ad72bb5a1603473d9420e90e8d1d694a134 Mon Sep 17 00:00:00 2001
> From: John Shahid <[email-masked]>
> Date: Wed, 26 Dec 2018 16:45:33 -0500
> Subject: [PATCH] Always set the source buffer before reverting
>
> * lisp/progmodes/flymake.el (flymake-show-diagnostics-buffer): Do it.
> ---
>  lisp/progmodes/flymake.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> index 7b100da42b..c773eb1c15 100644
> --- a/lisp/progmodes/flymake.el
> +++ b/lisp/progmodes/flymake.el
> @@ -1332,9 +1332,9 @@ flymake-show-diagnostics-buffer
>           (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)))))

Pushed your patch with a slight change to the commit message.

Marked it as "Copyright-Paperwork-Exempt", but now I see I shouldn't
have, as you have probably already signed papers since I see a lot more
commits to your name.

Anyway, thanks!
João