Subject: Re: bug#23168: 24.5; 24.5; rcirc: incorrect buffer handling on buffer kills

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 29 Jul 2019 00:43:06 +0200

xristos <[email-masked]> writes:

> emacs -Q
> M-x rcirc
> M-x kill-buffer RET y
> M-: rcirc-activity (notice how #<killed buffer> is there)
>
> 2 ways to trigger bug from this point:
>
> M-x rcirc 
> M-x kill-buffer RET y => error in process sentinel: Selecting deleted buffer
>
> OR
>
> M-x rcirc
> M-x ibuffer (or switch buffer to anything else and wait)
>
> switching back to rcirc buffer after the IDENT phase has completed
> will show "selecting deleted buffer" inline.

[...]

>   (when (eq major-mode 'rcirc-mode)
>     (when (and rcirc-log-flag
>                rcirc-log-directory)
>       (rcirc-log-write))
>     (rcirc-clean-up-buffer "Killed buffer")
> +    (rcirc-delete-process nil)

(I'm going through old Emacs bug reports that haven't received any
response.)

I don't use rcirc myself, but something along those lines (with a bit
more error checking) seems to be an the right thing to do, so I've now
done this for Emacs 27.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no