From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63058: 28.2; Emacs is terminated by Windows when logging off even if modified buffers are open Date: Fri, 05 May 2023 08:59:13 +0300 Message-ID: <83a5yjjp3i.fsf@gnu.org> References: <83sfcowkha.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14945"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63058@debbugs.gnu.org To: haraldsa@web.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 07:59:37 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1puoTh-0003fq-Ig for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 07:59:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puoTI-0000IL-W0; Fri, 05 May 2023 01:59:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puoT8-0000Hf-A5 for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 01:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puoT8-0001m7-2J for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 01:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puoT7-0004J2-UT for bug-gnu-emacs@gnu.org; Fri, 05 May 2023 01:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 May 2023 05:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63058 X-GNU-PR-Package: emacs Original-Received: via spool by 63058-submit@debbugs.gnu.org id=B63058.168326632316464 (code B ref 63058); Fri, 05 May 2023 05:59:01 +0000 Original-Received: (at 63058) by debbugs.gnu.org; 5 May 2023 05:58:43 +0000 Original-Received: from localhost ([127.0.0.1]:52937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puoSo-0004HS-SV for submit@debbugs.gnu.org; Fri, 05 May 2023 01:58:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puoSn-0004HB-Ke; Fri, 05 May 2023 01:58:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puoSi-0001gy-AM; Fri, 05 May 2023 01:58:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KdTR7IYaTHgWgSZafVIOURYeSN+i/+lloyKyQPd0wVw=; b=mzJ5gC/b98xb zC5JaPWSleO/pMTJAZeArNmRWDvhtqLxFZ8q8qcZZ9hfdC+eRLQ4SwHX/F3ZZgjZbThSXgF8Y7aVz FuggBqRjZ0WMXcjk1RmCnlTP1Rwe8jJIkuBHngHaB8qqtVQl6Z96P9rwoDu7vnqtpGfFdVVYukWEg qznoi3e2aNBBVDfG2NywL4WsyiiWYAEVUMq76lIk7o/rEcaBsGG406vHYx52fki/M/68sifangOtn Lr/8IgxtdazSsJrHO2HFzu25qN1OVJNmAwVljlWy6R/3qkEBfZ8+ZXY2GyRq/Xau7MjBXSXEMHOlA iZRLRQtiol8xHjzduSqk/Q==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puoSS-0005F4-DW; Fri, 05 May 2023 01:58:24 -0400 In-Reply-To: <83sfcowkha.fsf@gnu.org> (message from Eli Zaretskii on Tue, 25 Apr 2023 09:21:05 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:261061 Archived-At: tags 63058 notabug close 63058 thanks > Cc: 63058@debbugs.gnu.org > Date: Tue, 25 Apr 2023 09:21:05 +0300 > From: Eli Zaretskii > > This is not what happens; you saw only the first part of how Emacs on > Windows handles this situation, in the input thread. What actually > happens is that before the input thread starts sleeping above, it > posts the WM_ENDSESSION message, via the my_post_msg call, to the main > thread, where we have this: > > case WM_ENDSESSION: > inev.kind = END_SESSION_EVENT; > break; > > So this event gets inserted into the Emacs input event queue, and when > it is processed, we do: > > case END_SESSION_EVENT: > /* Make an event (end-session). */ > return list1 (Qend_session); > > The above produces a Lisp event 'end-session', for which we have a > default binding: > > initial_define_lispy_key (Vspecial_event_map, "end-session", > "kill-emacs"); > > IOW, this event by default calls the command kill-emacs. And that > command auto-saves any modified buffers that visit files, then shuts > down Emacs. > > > Would be great to have a proper handling. > > What is a proper handling in this case? delay the shutdown > indefinitely? that'd be even less proper, IMO. > > See also bug#23483 (which led to the existing implementation) and > specifically these messages there: > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23483#37 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23483#40 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23483#43 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23483#46 > > You could, if you like, bind the end-session event to a different > command, perhaps that will suit your usage better. But be very > careful when you do this, because invoking commands that require user > interaction will not work in this case: the Emacs' input thread, which > handles all kinds of inputs, is sleeping, so the user cannot interact > with Emacs. No further comments, so I'm now closing this issue, as I see no bug here: Emacs is behaving as intended.