From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Harald Sanftmann Newsgroups: gmane.emacs.bugs Subject: bug#63058: 28.2; Emacs is terminated by Windows when logging off even if modified buffers are open Date: Mon, 24 Apr 2023 17:48:59 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29587"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 To: 63058@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 24 22:27:32 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 1pr2ma-0007a8-26 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Apr 2023 22:27:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pr2m9-0001nD-4N; Mon, 24 Apr 2023 16:27:05 -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 1pr2m6-0001mk-Nh for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2023 16:27:02 -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 1pr2m6-0005lA-GH for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2023 16:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pr2m6-00008i-0w for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2023 16:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Harald Sanftmann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2023 20:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63058 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1682367967475 (code B ref -1); Mon, 24 Apr 2023 20:27:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Apr 2023 20:26:07 +0000 Original-Received: from localhost ([127.0.0.1]:50426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pr2lA-00007V-39 for submit@debbugs.gnu.org; Mon, 24 Apr 2023 16:26:07 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqyRC-0006jA-9T for submit@debbugs.gnu.org; Mon, 24 Apr 2023 11:49:10 -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 1pqyR7-00079J-FU for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2023 11:49:06 -0400 Original-Received: from mout.web.de ([212.227.17.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqyR5-0004Bk-D4 for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2023 11:49:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1682351340; i=haraldsa@web.de; bh=K+m6W6J9V0b4A63TMgsOvnXi1UPdkmBDN7xvNEW9LRc=; h=X-UI-Sender-Class:Date:To:From:Subject; b=mE+CBcpByVhHByCK4B2jJRS+E8Y3qi7cuDDn0imA1ePuTqq5xEf4Zt1B4RiVe4Z50 fnGcHILa6h9gu6ad78zh61tg+9ClyYveJIV1O3+pJ1ZBvlKxvDNfIkwSa5Fq0VwRT4 aOUAuwACxCeCTlkbt73gTL6ro3RqGgT4b+KvqHdhwQ8pm75fRv0WX8WmAqq9uT1hxr utZGKgLupEyQ851XQmXaHR9zdYuGjDL6abw2bSaB3YXAvFrVp/6PMEInOE+q4Zkyee 6iQs/BZNV0Bcl/eGoFiaqEuYKh/x0waB5gQZRh4WsYMNLMT9eHdLtJq99FbkdxNixD NwnzAfxIK9ULQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from [192.168.0.146] ([95.91.251.77]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1N9LEU-1qKa4G0x4G-015DaI for ; Mon, 24 Apr 2023 17:49:00 +0200 Content-Language: de-DE X-Provags-ID: V03:K1:+JZ2QDh+C3qf6v0YBUGQczRhlelcwQ/e0/CPn3l0IA+45hIHYH3 ELHV+ZP/z3yX3EVZnQlv5GfPCuxSVv8bespHVW4vhJf8TH8b/GubtleSXJye5bD8IW5etFO g9zBAjJCO9okLp3vR+Rc970vJu+ABSyPcnOAYqPCzVWM0NyfhCXNFYGVpHxB+Nk5KlQq5ZJ ZZWuD4huaFf4jbpz5bHHA== UI-OutboundReport: notjunk:1;M01:P0:wOxih9F2UgM=;QFTdTZcm10QuB5q3R45LEQS649o FjVnbqj+NaVc8XLNpR5w74psbJawxB7apUU5Fqho9fG9zQodNLFz5ZkLIpNToanExDt88fSi/ DZMftIjnNzvExJVBOhkXyfK62QCrbRdvvdnqy/W5x4TSQ15IhdguOloaGtrQ0OeL9G4Cp+1+Q Jv7zC1CNkn/jVgmz85mjIaXPxmaPy88evwJZGSuj0X4sd5bRCSvJhS7ETtDLNq9tJKNNa65Tc A5FkTOPgQ8zpr1gMaMhxxYoQM8LmAYG6zAFOFGHJJ4IlTKxOEo9tjFY+vzsSaaAFlijgAxb+e D2tsaI5kN2GgYl32Rz8as+FNP7T7Ns1+LJiuWd1zW6rRX2jFMmHn+mCythi7H/zAXlSjb2FUD tbzyeiKkHF7KsMnL3bBvB5buHOgpzUE/yqKPxwBL57/P6uxj/L/A7Gao/kQzEc82wBaO4SjwP itpTx9HoF0BbTuUsq2JsOE12gcPzmAot/N3E3e1y/FxJVtUJmqV+Mkz1zm9lYfrUyXhzOgKCG TqtWsxfzqj7KLFe1cB0a2TFg+9X91i70pmlMP5x0HJsMwVk/1KDvd6BEzRncW6mwv6TEHdUix 2dcdTWzP/EI/Afwhnx8nDEsdLpv95iv/wcgyg4/AuGKwZTzNNaTYVS6QtRGo9mHpVsWyy0d3Z rFiWulktqmfjYP5clyyOZnnvscjSfFpg1sXTYwx614+vppQSKO4WFylKvLTDeRmIzpaFvZHr7 FLW99i/Gz2cWyZnTdzjSg2VIUZil9ZqZ6+OV44XNMbQ9H+GKZdtYzfC8nlIY+9MuDBySGdLv Received-SPF: pass client-ip=212.227.17.11; envelope-from=haraldsa@web.de; helo=mout.web.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 24 Apr 2023 16:26:03 -0400 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:260584 Archived-At: Hi everybody, From time to time it happens that I have not closed Emacs before logging out. Windows just terminates the process even if modified buffers are open. I searched for a solution and learned how Windows is telling applications to prepare for the user logging off / Windows is shutting down: https://www.howtogeek.com/396277/what-exactly-happens-when-you-shut-down-o= r-sign-out-of-windows/ WM_QUERYENDSESSION and WM_ENDSESSION are the sent signals, if the application does not respond it will be terminated after 5 seconds. Then I found some code which could be the Emacs implementation: https://github.com/emacs-mirror/emacs/blob/master/src/w32fns.c switch (msg) { case WM_ERASEBKGND: ... case WM_ENDSESSION: my_post_msg (&wmsg, hwnd, msg, wParam, lParam); /* Allow time for Emacs to attempt an orderly shutdown. If we return, the process will be terminated immediately. FIXME: 1000 seconds is too long to sleep if the shutdown attempt fails (see bug#25875). But if it fails, we want to find out about it, so let's leave 1000 for now. */ sleep (1000); FALLTHROUGH; Seems like Emacs does not respond but sleeps for 1000 s. This will probably not cut it. Would be great to have a proper handling. Thanks & Reards, Harald In GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2022-09-13 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.22621 System Description: Microsoft Windows 10 Pro (v10.0.2009.22621.1555) Configured using: 'configure --with-modules --without-dbus --with-native-compilation --without-compress-install CFLAGS=3D-O2' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM ZLIB (NATIVE_COMP present but libgccjit not available) Important settings: value of $LANG: DEU locale-coding-system: cp1252 Major mode: Org