From: Po Lu Date: Thu, 14 Jul 2022 03:47:00 +0000 (+0800) Subject: Fix killing Emacs upon display disconnect X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~1886^2~957 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d37ba6f259b972aa44c66ecb76210e03a3084183;p=emacs.git Fix killing Emacs upon display disconnect * src/xterm.c (x_connection_closed): On Xt builds terminals can be left alive without any frames on them, so take that into account. (bug#56528) --- diff --git a/src/xterm.c b/src/xterm.c index 3dfbe111d3f..1d0e69d32bc 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -23531,7 +23531,11 @@ For details, see etc/PROBLEMS.\n", unblock_input (); - if (terminal_list == 0) + /* Sometimes another terminal is still alive, but deleting this + terminal caused all frames to vanish. In that case, simply kill + Emacs, since the next redisplay will abort as there is no more + selected frame. (bug#56528) */ + if (terminal_list == 0 || NILP (selected_frame)) Fkill_emacs (make_fixnum (70), Qnil); totally_unblock_input ();