From unknown Mon Jun 16 23:46:53 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#51993 <51993@debbugs.gnu.org> To: bug#51993 <51993@debbugs.gnu.org> Subject: Status: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Reply-To: bug#51993 <51993@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:46:53 +0000 retitle 51993 29.0.50; [PATCH] Killing emacsclient terminal with `server-st= op-automatically' doesn't prompt to save files reassign 51993 emacs submitter 51993 Jim Porter severity 51993 normal tag 51993 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 19 23:29:53 2021 Received: (at submit) by debbugs.gnu.org; 20 Nov 2021 04:29:53 +0000 Received: from localhost ([127.0.0.1]:41155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moI0e-0007gp-VY for submit@debbugs.gnu.org; Fri, 19 Nov 2021 23:29:53 -0500 Received: from lists.gnu.org ([209.51.188.17]:33270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moI0c-0007gh-E7 for submit@debbugs.gnu.org; Fri, 19 Nov 2021 23:29:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moI0c-00005X-8K for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 23:29:50 -0500 Received: from [2a00:1450:4864:20::134] (port=42866 helo=mail-lf1-x134.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moI0a-0006kT-9N for bug-gnu-emacs@gnu.org; Fri, 19 Nov 2021 23:29:50 -0500 Received: by mail-lf1-x134.google.com with SMTP id t26so52359268lfk.9 for ; Fri, 19 Nov 2021 20:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:message-id:date:mime-version:content-language; bh=igNvVT4lMd8Hby+IMUE6PwwIAF8alWg9+RKdHTVDdcc=; b=VcqgL/HGV4zPLYP+iPO4JDKyIoYvKtDAy9rH2f4jJmUWNiXeHomLNo43MxTXa7F92n WW1RgIm/7YEBxjUSJ3WtRjy5PTeo7K7ZuR/nopsEqgVZoXhN+02emMKA3WBGQ4c9vWI7 WyAv30nEWrukURi3asYuAfdnortxi1aUu70kvVTJxCYEzwW66WyGTfLufVcmKHetMeQE W85WQ+2Bo6fCDyE3WcNPlLoLGSjUdjOaB97mU4yxvsjWB6ixgXerPHpEIgPCMDsLgTqg B957cRzRxfK5wpbmxv6fYr//UNDQsHI498u8V6G1OqCmPnxUOIHL0wIwLdZ4WnXdjUZP St+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:mime-version :content-language; bh=igNvVT4lMd8Hby+IMUE6PwwIAF8alWg9+RKdHTVDdcc=; b=NJ3C8lsJTb10KCnDrSNqSC1sD3RYGGORbc59nfcIip4H4r8P/g86wXRQtXqDsEIxra AiF67JuLYfMpHqJZoEXw6u2pkkHbbUDNSDvsum3tugC8ANTWUCTMohbhQC2nVHBVO8aw +iBOz7rnP9RkXY/IkcIhyxbxavrmM98upDc1M0pg+FDI5/Bz4oipOkq05E104rx9NO2y g1MN0xX8TSWTPmulh6nQT0s7rr+KKckb7s/KvLyvVoHCIrvSi7+re3McZMyg48w+FztA AbuR+1KNqck7HQWaqccK+RoHishMN8WXDPLswt7tZI7mKonLcLuUsb46f2LiItMH+saG IsCg== X-Gm-Message-State: AOAM530L9zTi2qej7Xin+kKOQ5OLZ/QayoroMUCMJp0CM2lddRvYPUcn C9C9x8spboBERT9l0/vYXqyxjOOfP2s= X-Google-Smtp-Source: ABdhPJxktFswWtJ0Z/cA5qkBX+jmdoo5KzTWKE+EWCVCyM3WGuUc1+a9dOl53tBOK0VQbO6+Tx8enQ== X-Received: by 2002:ac2:5dc2:: with SMTP id x2mr38668739lfq.228.1637382585774; Fri, 19 Nov 2021 20:29:45 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id v8sm196978lfi.43.2021.11.19.20.29.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Nov 2021 20:29:44 -0800 (PST) X-Mozilla-News-Host: news://news.gmane.org:119 From: Jim Porter Subject: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: bug-gnu-emacs@gnu.org Message-ID: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> Date: Fri, 19 Nov 2021 20:29:43 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------C07135EFA8A344D076699CA3" Content-Language: en-US X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::134 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=jporterbugs@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------C07135EFA8A344D076699CA3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit When killing an emacsclient terminal via C-x C-c, it should prompt to save the files initially passed to emacsclient. To see this in action: $ emacs -Q --daemon $ emacsclient -a "" -c foo.txt $ emacsclient -a "" -c bar.txt ;; In the first client frame: foobar ;; Insert some text C-x C-c ;; Emacs prompts "Save file /path/to/foo.txt?..." Now try the above, but call `(server-stop-automatically 'delete-frame)' first (or replace `delete-frame' with `kill-terminal'; it doesn't matter). In this case, Emacs doesn't prompt to save the file. However, the docstring/comments in `server-save-buffers-kill-terminal' say that it should: "Offer to save each buffer, then kill the current client. ... Only files from emacsclient file list." Attached is a patch to restore this behavior when stopping the server automatically. This puts all of the logic into `server-save-buffers-kill-terminal', which allows `server-stop-automatically--handle-delete-frame' to be simpler. I've also added some more detailed comments explaining the logic here, since there are some pretty subtle aspects to it. There's a further subtlety that I should probably mention here though: when killing a nowait frame, it would kill Emacs entirely if that were the last frame (even in Emacs 28, and probably earlier). The only way (that I can think of) that this could come up would be to run: $ emacs -Q --eval '(start-server)' $ emacsclient -n C-x 5 0 ;; in the non-client frame C-x C-c ;; in the emacsclient frame However, when doing this with a regular (non-nowait) client, the last step would report the error "Attempt to delete the sole visible or iconified frame". Even more oddly, it would work the *second* time you tried to kill the client terminal, since `server-delete-client' would set the `client' frame-parameter to nil before deleting it; on the second attempt, Emacs thinks the frame is a non-client frame (even though it is). I've fixed this in the second patch by following the nowait behavior: if you kill a client and *all* the existing frames belong to that client, it kills Emacs entirely. I'm not sure this will come up often in practice, but it's a fairly simple change. Some tests would be nice to prevent this from regressing, but I'm not sure how to write a test that starts up a daemon and connects clients to it... --------------C07135EFA8A344D076699CA3 Content-Type: text/plain; charset=UTF-8; name="0001-Ensure-killing-an-emacsclient-terminal-prompts-to-sa.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-Ensure-killing-an-emacsclient-terminal-prompts-to-sa.pa"; filename*1="tch" RnJvbSA1NjMwMzZlYWYwOTI0ZjQ3NzdmMjVlNzRlOWY2MTE0MTlmYzAzMWNmIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IEZyaSwgMTkgTm92IDIwMjEgMTk6NDk6MzggLTA4MDAKU3ViamVjdDogW1BB VENIIDEvMl0gRW5zdXJlIGtpbGxpbmcgYW4gZW1hY3NjbGllbnQgdGVybWluYWwgcHJvbXB0 cyB0byBzYXZlCiBmaWxlcwoKUHJldmlvdXNseSwgd2hlbiB1c2luZyAnc2VydmVyLXN0b3At YXV0b21hdGljYWxseScsIGtpbGxpbmcgYW4KZW1hY3NjbGllbnQgdGVybWluYWwgd291bGRu J3QgcHJvbXB0IHRoZSB1c2VyIHRvIHNhdmUgdGhlIGZpbGVzCmluaXRpYWxseSBwYXNzZWQg dG8gZW1hY3NjbGllbnQgKHVubGVzcyBpdCB3YXMgdGhlIGxhc3QgY2xpZW50KS4KCiogbGlz cC9zZXJ2ZXIuZWwgKHNlcnZlci1zYXZlLWJ1ZmZlcnMta2lsbC10ZXJtaW5hbCk6IENoZWNr CidzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5JyBhbmQgaGFuZGxlIGtpbGxpbmcgRW1hcyBh cyBuZWVkZWQuCihzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5LS1oYW5kbGUtZGVsZXRlLWZy YW1lKTogUmVtb3ZlIGxvZ2ljCnNwZWNpZmljIHRvICdzYXZlLWJ1ZmZlcnMta2lsbC10ZXJt aW5hbCcuCi0tLQogbGlzcC9zZXJ2ZXIuZWwgfCA5NCArKysrKysrKysrKysrKysrKysrKysr KysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogMSB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cHJvYykKLQkgICAgIChsZXQgKChidWZmZXJzIChwcm9j ZXNzLWdldCBwcm9jICdidWZmZXJzKSkpCi0JICAgICAgIChzYXZlLXNvbWUtYnVmZmVycwot CSAgICAgICAgYXJnIChpZiBidWZmZXJzCi0gICAgICAgICAgICAgICAgICAgICAgICA7OyBP bmx5IGZpbGVzIGZyb20gZW1hY3NjbGllbnQgZmlsZSBsaXN0LgotCQkgICAgICAgIChsYW1i ZGEgKCkgKG1lbXEgKGN1cnJlbnQtYnVmZmVyKSBidWZmZXJzKSkKLSAgICAgICAgICAgICAg ICAgICAgICA7OyBObyBlbWFjc2NsaWVudCBmaWxlIGxpc3Q6IGRvbid0IG92ZXJyaWRlCi0g ICAgICAgICAgICAgICAgICAgICAgOzsgYHNhdmUtc29tZS1idWZmZXJzLWRlZmF1bHQtcHJl ZGljYXRlJyAodW5sZXNzCi0gICAgICAgICAgICAgICAgICAgICAgOzsgQVJHIGlzIG5vbi1u aWwpLCBzaW5jZSB3ZSdyZSBub3Qga2lsbGluZwotICAgICAgICAgICAgICAgICAgICAgIDs7 IEVtYWNzICh1bmxpa2UgYHNhdmUtYnVmZmVycy1raWxsLWVtYWNzJykuCi0JCSAgICAgIChh bmQgYXJnIHQpKSkKLQkgICAgICAgKHNlcnZlci1kZWxldGUtY2xpZW50IHByb2MpKSkKLQkg ICAgKHQgKGVycm9yICJJbnZhbGlkIGNsaWVudCBmcmFtZSIpKSkpKSkKKyAgKGxldCAoKHBy b2MgKGZyYW1lLXBhcmFtZXRlciBuaWwgJ2NsaWVudCkpKQorICAgIChjb25kICgoZXEgcHJv YyAnbm93YWl0KQorICAgICAgICAgICA7OyBOb3dhaXQgZnJhbWVzIGhhdmUgbm8gY2xpZW50 IGJ1ZmZlciBsaXN0LgorICAgICAgICAgICAoaWYgKGlmIHNlcnZlci1zdG9wLWF1dG9tYXRp Y2FsbHkKKyAgICAgICAgICAgICAgICAgICAoY2RkciAoZnJhbWUtbGlzdCkpCisgICAgICAg ICAgICAgICAgIChjZHIgKGZyYW1lLWxpc3QpKSkKKyAgICAgICAgICAgICAgIDs7IElmIHRo ZXJlIGFyZSBhbnkgb3RoZXIgZnJhbWVzIChleGNsdWRpbmcgdGhlIGRhZW1vbgorICAgICAg ICAgICAgICAgOzsgZnJhbWUgd2hlbiBgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseScgaXMg bm9uLW5pbCksCisgICAgICAgICAgICAgICA7OyBvbmx5IGRlbGV0ZSB0aGlzIGZyYW1lLiAg RklYTUU6IEl0IHdvdWxkIGJlIG5pY2UgdG8KKyAgICAgICAgICAgICAgIDs7IGRlbGV0ZSBh bnkgb3RoZXIgZnJhbWVzIGNyZWF0ZWQgYnkgdGhpcyBmcmFtZSAoYXMKKyAgICAgICAgICAg ICAgIDs7IHdoZW4ga2lsbGluZyB0aGUgdGVybWluYWwgb2YgYW4gb3JkaW5hcnkgY2xpZW50 CisgICAgICAgICAgICAgICA7OyBiZWxvdyksIGJ1dCB3ZSBjYW4ndCBkaXN0aW5ndWlzaCBz ZXBhcmF0ZSBncm91cHMgb2YKKyAgICAgICAgICAgICAgIDs7IG5vd2FpdCBmcmFtZXMgY3Vy cmVudGx5LgorICAgICAgICAgICAgICAgKHByb2duIChzYXZlLXNvbWUtYnVmZmVycyBhcmcp CisgICAgICAgICAgICAgICAgICAgICAgKGRlbGV0ZS1mcmFtZSkpCisgICAgICAgICAgICAg OzsgSWYgd2UncmUgdGhlIGxhc3QgZnJhbWUgc3RhbmRpbmcsIGtpbGwgRW1hY3MuCisgICAg ICAgICAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVtYWNzIGFyZykpKQorICAgICAgICAgICgo cHJvY2Vzc3AgcHJvYykKKyAgICAgICAgICAgKGlmIChzZXEtc29tZQorICAgICAgICAgICAg ICAgIChsYW1iZGEgKGZyYW1lKQorICAgICAgICAgICAgICAgICAgKGxldCAoKHAgKGZyYW1l LXBhcmFtZXRlciBmcmFtZSAnY2xpZW50KSkpCisgICAgICAgICAgICAgICAgICAgICh1bmxl c3MgKGFuZCBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5IChudWxsIHApKQorICAgICAgICAg ICAgICAgICAgICAgIChub3QgKGVxdWFsIHByb2MgcCkpKSkpCisgICAgICAgICAgICAgICAg KGZyYW1lLWxpc3QpKQorICAgICAgICAgICAgICAgOzsgSWYgdGhlcmUgYXJlIGFueSBmcmFt ZXMgZnJvbSBvdGhlciBjbGllbnRzLCBvbmx5CisgICAgICAgICAgICAgICA7OyBkZWxldGUg dGhpcyBjbGllbnQuICBJZiBgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseScKKyAgICAgICAg ICAgICAgIDs7IGlzIG5pbCwgY2hlY2sgZm9yIGZyYW1lcyBmcm9tIHRoZSBzZXJ2ZXIgcHJv Y2VzcyBhcworICAgICAgICAgICAgICAgOzsgd2VsbC4KKyAgICAgICAgICAgICAgIChsZXQg KChidWZmZXJzIChwcm9jZXNzLWdldCBwcm9jICdidWZmZXJzKSkpCisgICAgICAgICAgICAg ICAgIChzYXZlLXNvbWUtYnVmZmVycworICAgICAgICAgICAgICAgICAgYXJnIChpZiBidWZm ZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IE9ubHkgZmlsZXMgZnJvbSBlbWFj c2NsaWVudCBmaWxlIGxpc3QuCisgICAgICAgICAgICAgICAgICAgICAgICAgIChsYW1iZGEg KCkgKG1lbXEgKGN1cnJlbnQtYnVmZmVyKSBidWZmZXJzKSkKKyAgICAgICAgICAgICAgICAg ICAgICAgIDs7IE5vIGVtYWNzY2xpZW50IGZpbGUgbGlzdDogZG9uJ3Qgb3ZlcnJpZGUKKyAg ICAgICAgICAgICAgICAgICAgICAgIDs7IGBzYXZlLXNvbWUtYnVmZmVycy1kZWZhdWx0LXBy ZWRpY2F0ZScKKyAgICAgICAgICAgICAgICAgICAgICAgIDs7ICh1bmxlc3MgQVJHIGlzIG5v bi1uaWwpLCBzaW5jZSB3ZSdyZSBub3QKKyAgICAgICA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j bG9zaW5nIG9mIEVtYWNzIGRhZW1vbiB3aGVuIGBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5 JyBpcyB1c2VkLiIKLS0gCjIuMjUuMQoK --------------C07135EFA8A344D076699CA3 Content-Type: text/plain; charset=UTF-8; name="0002-Don-t-explicitly-delete-client-frames-when-killing-E.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0002-Don-t-explicitly-delete-client-frames-when-killing-E.pa"; filename*1="tch" RnJvbSBjY2NiYTc3ODRkN2E1YWY0MWI2NTFhYjBjMjlkMjMzOWJlYmM2NzMyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IEZyaSwgMTkgTm92IDIwMjEgMjA6MTQ6MzMgLTA4MDAKU3ViamVjdDogW1BB VENIIDIvMl0gRG9uJ3QgZXhwbGljaXRseSBkZWxldGUgY2xpZW50IGZyYW1lcyB3aGVuIGtp bGxpbmcgRW1hY3MKIGFueXdheQoKVGhpcyByZXNvbHZlcyBhbiBvYnNjdXJlIGlzc3VlIHdo ZXJlIGtpbGxpbmcgYW4gZW1hY3NjbGllbnQgdGVybWluYWwKd2hlbiB0aGVyZSB3ZXJlIG5v IG90aGVyIGZyYW1lcyB3b3VsZCBmYWlsLiBOb3csIGtpbGxpbmcgdGhlIHRlcm1pbmFsCnBy b3Blcmx5IGtpbGxzIEVtYWNzLgoKKiBsaXNwL3NlcnZlciAoc2VydmVyLXN0YXJ0KTogQWRk ICdub2ZyYW1lJyBvcHRpb24gdG8gYXZvaWQgZGVsZXRpbmcKZnJhbWVzLgooc2VydmVyLWZv cmNlLXN0b3ApOiBQYXNzICdub2ZyYW1lJyB0byAnc2VydmVyLXN0b3AnLgotLS0KIGxpc3Av c2VydmVyLmVsIHwgMTAgKysrKysrKy0tLQogMSBmaWxlIGNoYW5nZWQsIDcgaW5zZXJ0aW9u cygrKS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ZXItc3RhcnQgdCB0KSkKKyAgKHNl cnZlci1zdGFydCB0IHQgJ25vZnJhbWUpKQogCiA7OzsjIyNhdXRvbG9hZAogKGRlZnVuIHNl cnZlci1mb3JjZS1kZWxldGUgKCZvcHRpb25hbCBuYW1lKQotLSAKMi4yNS4xCgo= --------------C07135EFA8A344D076699CA3-- From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 20 02:13:17 2021 Received: (at 51993) by debbugs.gnu.org; 20 Nov 2021 07:13:17 +0000 Received: from localhost ([127.0.0.1]:41441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moKYn-0004H4-Fs for submit@debbugs.gnu.org; Sat, 20 Nov 2021 02:13:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moKYk-0004Gm-PV for 51993@debbugs.gnu.org; Sat, 20 Nov 2021 02:13:15 -0500 Received: from [2001:470:142:3::e] (port=58194 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moKYf-0003vt-Fb; Sat, 20 Nov 2021 02:13:09 -0500 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=Sy6ukUx2tMCj5TuZy/AKwcDYAa0ycxhaQuKf51dfbf4=; b=D+qTLwymbLBA 6fjOknnAJs09ggU2qsbSrFYEYidJhYTAk8AK4yW5uU1/qJsqIxO+Y1HRitKt/KFZ+6aGhynr0s4yK 3cHajzaWuv1Efj/FDu6l2c7IKEx2o18rwXhwzQIcCBEEHORgKcOLrYcK2RrrkIRP5lTeHusCFREAt P2ho4JjdIvOdznzoN5nG2NGfFHeco69CIJSBi6wVGNRoDcVoVOXfmaJa7yoOBGR2nkC3brrKyLLFO MPOrZaBvrt27dksqfsSHzUqmhVM+6ygggpuHSCsiAsP4Hd6X1CaSNn4CBBcJZ6eO5WcFwNAMRSets yvzdTk6EvRtAi6kQygy7WQ==; Received: from [87.69.77.57] (port=2172 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 1moKYe-0004jO-5w; Sat, 20 Nov 2021 02:13:09 -0500 Date: Sat, 20 Nov 2021 09:13:10 +0200 Message-Id: <83pmqvti49.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter , Gregory Heytings In-Reply-To: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> (message from Jim Porter on Fri, 19 Nov 2021 20:29:43 -0800) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Jim Porter > Date: Fri, 19 Nov 2021 20:29:43 -0800 > > When killing an emacsclient terminal via C-x C-c, it should prompt to > save the files initially passed to emacsclient. To see this in action: > > $ emacs -Q --daemon > $ emacsclient -a "" -c foo.txt > $ emacsclient -a "" -c bar.txt > > ;; In the first client frame: > foobar ;; Insert some text > C-x C-c > ;; Emacs prompts "Save file /path/to/foo.txt?..." > > Now try the above, but call `(server-stop-automatically 'delete-frame)' > first (or replace `delete-frame' with `kill-terminal'; it doesn't > matter). In this case, Emacs doesn't prompt to save the file. However, > the docstring/comments in `server-save-buffers-kill-terminal' say that > it should: "Offer to save each buffer, then kill the current client. ... > Only files from emacsclient file list." Gregory, any comments? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 04:48:20 2021 Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 09:48:20 +0000 Received: from localhost ([127.0.0.1]:50043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpSPT-0001GL-QW for submit@debbugs.gnu.org; Tue, 23 Nov 2021 04:48:20 -0500 Received: from heytings.org ([95.142.160.155]:45828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpSPP-0001G9-Jr for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 04:48:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1637660894; bh=4qdCcJrsE+NbySNYjvr4415GLpCDQxGS0XrjoBan5CU=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=Y5CrlCV2VegveB/AUZw6otr09+d9oYg9iAqLg0GI7t8273jlc9tfOnbTm0hvZfPoz ksolu4PcQpOkMYygwBdZcEWuUoImmhJ62fjDMB7W93iNBfm++lT5qqHqB3ZbSR8e+p KbfNsyoUH4msXSmIawfufg/6K1f0rg+90An1ma853E+jcrONQfRbJgGSjeD81Ic/+m 1TDHvJlkqYOpC1HZTFhORXukKicBkTxDVGop2plc+hei3tUv+QPNuCH4DO5smvFAQx xLfjGMRqOM3AYsHcN+ox86Lnc8JAM9wShX+WGV/SnDs/CONfY8TBk7PIK0oIDQw9eG gbULtFaiCfYjQ== Date: Tue, 23 Nov 2021 09:48:13 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files In-Reply-To: <83pmqvti49.fsf@gnu.org> Message-ID: <890d44ded2b56811ceff@heytings.org> References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sgDcgKw0xL" Content-ID: <890d44ded22c70b308ee@heytings.org> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: Jim Porter , 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --sgDcgKw0xL Content-Type: text/plain; charset=us-ascii; format=flowed Content-ID: <890d44ded27785cbe645@heytings.org> >> When killing an emacsclient terminal via C-x C-c, it should prompt to >> save the files initially passed to emacsclient. To see this in action: >> >> $ emacs -Q --daemon >> $ emacsclient -a "" -c foo.txt >> $ emacsclient -a "" -c bar.txt >> >> ;; In the first client frame: >> foobar ;; Insert some text >> C-x C-c >> ;; Emacs prompts "Save file /path/to/foo.txt?..." >> >> Now try the above, but call `(server-stop-automatically 'delete-frame)' >> first (or replace `delete-frame' with `kill-terminal'; it doesn't >> matter). In this case, Emacs doesn't prompt to save the file. However, >> the docstring/comments in `server-save-buffers-kill-terminal' say that >> it should: "Offer to save each buffer, then kill the current client. >> ... Only files from emacsclient file list." > > Gregory, any comments? > This is not a bug, this is the intented behavior of that feature, which was discussed on emacs-devel and in bug#51377. But in commit 997ca88ef44 the word "last" disappeared in the explanation of the meaning of the symbol 'kill-terminal': "when the last frame is being closed" became "when the terminal is killed". Hence the confusion. I attached a patch which preserves the intended behavior of that feature, and adds a fourth possible behavior, the one Jim now wants. --sgDcgKw0xL Content-Type: text/x-diff; name=Improve-and-extend-server-stop-automatically.patch; charset=us-ascii Content-Transfer-Encoding: base64 Content-ID: <890d44ded2c14f37d541@heytings.org> Content-Description: Content-Disposition: attachment; filename=Improve-and-extend-server-stop-automatically.patch RnJvbSA0YTNiOGNlY2ZjMDkxY2I0OGY3N2Y4YTVhM2EzOTM0ZWMzODNkMjJk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wtZW1hY3MpKQ0KLSAgICAg KChlcSBhcmcgJ2RlbGV0ZS1mcmFtZSkNCisgICAgICgoZXEgYXJnICdkZWxl dGUtbGFzdC1mcmFtZSkNCiAgICAgICAoYWRkLWhvb2sgJ2RlbGV0ZS1mcmFt ZS1mdW5jdGlvbnMNCiAJCSMnc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0t aGFuZGxlLWRlbGV0ZS1mcmFtZSkpDQorICAgICAoKGVxIGFyZyAna2lsbC1s YXN0LXRlcm1pbmFsKSkNCiAgICAgICgoZXEgYXJnICdraWxsLXRlcm1pbmFs KSkNCiAgICAgICh0DQogICAgICAgKGVycm9yICJVbmV4cGVjdGVkIGFyZ3Vt ZW50IikpKSkpDQotLSANCjIuMzMuMA0KDQo= --sgDcgKw0xL-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 13:25:28 2021 Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 18:25:28 +0000 Received: from localhost ([127.0.0.1]:52255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpaTv-0007iZ-Ix for submit@debbugs.gnu.org; Tue, 23 Nov 2021 13:25:27 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:46977) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpaTs-0007iL-PR for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 13:25:26 -0500 Received: by mail-pj1-f45.google.com with SMTP id np6-20020a17090b4c4600b001a90b011e06so3633149pjb.5 for <51993@debbugs.gnu.org>; Tue, 23 Nov 2021 10:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=8jYQRGQ7ImTw84ITqH6fbfWHu+8RZube9rXD6RAqWs0=; b=gpYQT7wOvCFeUNIExRsssbpuh7Xx+oZe98F3yF0RGiavi0cgua7OG6ZnzkJQlJlRM3 wexbITOCEZYQzwr3YFMux4kJwNnmjuqv17PMOvJbkRboBH7BObdkrPa47b7a6Ngy1P3E jzhgk7ZyJt4Qr8OA+I4dRlkoIOj+YVRZQtvV7wv8w720eNgB1n5d2TREPPE4RNRG7+Ih Asx+56iInGOobikBbbgy9+8doHXQzZlOmIZ2VTvCQXHMyyOJMXwY3x97/QrOI4gPR11f GlO+lG6/nETyi+qtNpuTd8Pz9n2elblJqsNMIAijedwczhhUi6jdTgAojfw2Bs8OJIz7 k75Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8jYQRGQ7ImTw84ITqH6fbfWHu+8RZube9rXD6RAqWs0=; b=zqDFJGIgB76KI/K/mOWd10ALFrMWYWJ4WiED+v99WsEdZoCUCEfWCiFaTeeYNjpgQr yDkoQxgcnJjIVLLz7YXI8JFf4sd9V+dkj0ZLA3bM/+0/YNWOhBPzJ7gUJ8ZWT14MJPz6 VFR/6qpUOJ7M/ixR/TdpPqs/xGjs7ydIcdXZFTZgBQpRZf0L1QZ6H5E58IipBPcAiQDI kDqp0YrPNi/bXEpCZo/yl0x102rW8aeZRXlf6OJZosxs1GqcmFiKd1K7WyMvPGM0f8Fl yqbPTn/FsQbfcfcH5LGZjbAoFX7X80FYlGJDlOKnHakN5DorSfST7qhdQi2jJXfcLA6W DNkQ== X-Gm-Message-State: AOAM530xpOUdguiEEzB4K6BHuNd0XbXJyMlLO/ET7DK19joPm+ArM85y QIuVJ27d7a7K/EK9kZ/CEd0= X-Google-Smtp-Source: ABdhPJxXbz3UfURmL/bLvCpcEqEw5jKjAHYo6yQRvxkInBO/GrPpp/kmcsGlmCUyJOJkvWILtNbRXw== X-Received: by 2002:a17:90b:128d:: with SMTP id fw13mr5590864pjb.50.1637691918818; Tue, 23 Nov 2021 10:25:18 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id a12sm9335311pgg.28.2021.11.23.10.25.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Nov 2021 10:25:18 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: Gregory Heytings , Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> From: Jim Porter Message-ID: <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> Date: Tue, 23 Nov 2021 10:25:19 -0800 MIME-Version: 1.0 In-Reply-To: <890d44ded2b56811ceff@heytings.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (Cc'ing Lars since he merged the previous patch, and I want to be sure everyone's on the same page here.) On 11/23/2021 1:48 AM, Gregory Heytings wrote: > This is not a bug, this is the intented behavior of that feature, which > was discussed on emacs-devel and in bug#51377. I started that discussion[1] (and participated throughout it), and I don't think we actually agreed that this was the intended behavior. The closest I see is this: On 10/24/2021 11:08 AM, Jim Porter wrote[2]: > I don't think this is true in general. The docstring for > `server-save-buffers-kill-terminal' says: "If emacsclient was started > with a list of filenames to edit, then only these files will be asked to > be saved." As a result, some files with unsaved changes may still exist, > so we'd want to prompt about those *before* the last frame is closed. However, I should stress that the case I brought up above is just a counterexample to show a problem with a previous implementation strategy, not a full specification. That's part of why I posted patches in bug#51377 in the hopes that an implementation would explain the behavior I intend more precisely than prose. The current behavior on Emacs 29 certainly isn't what I personally intended when bringing the idea up on emacs-devel. On 11/23/2021 1:48 AM, Gregory Heytings wrote: > I attached a patch which preserves the intended behavior of that > feature, and adds a fourth possible behavior, the one Jim now wants. I'm concerned that we're now up to 4 different behaviors, when I think two of them are just the result of a miscommunication between the two of us. The way I've interpreted our prior discussion is that you would prefer the daemon to be killed invisibly if there's no reason to keep it alive; this is the `empty' option in your patches. On the other hand, I'd prefer to the daemon to be killed "loudly" when there are no non-daemon frames left, including being prompted to save buffers, kill processes, etc in all the "usual" cases; this is `delete-last-frame' in your patch, plus a couple of other tweaks I have pending. (Note: Just to be clear, this isn't a specification; it's only a brief summary.) I think your message to me in bug#51377 encapsulates this well: On 10/24/2021 2:37 PM, Gregory Heytings wrote[3]: > I see. We have different mental models, I guess. From my viewpoint > the Emacs server should stay there until it's not necessary, and I'd be > surprised to be queried about what to do with buffers opened of > processes started in a frame I already closed when I want to close > another frame. But of course I do not object to have both behaviors. However, in your next two messages in the bug, you added: On 10/26/2021 3:37 AM, Gregory Heytings wrote[4]: > If it's now also necessary to kill the daemon when you close the > last Emacs frame with the window manager close button (I did not see > this requirement in your original post)... On 10/26/2021 4:59 AM, Gregory Heytings wrote[5]: > It just occurred to me that it's very easy to add a third behavior, > namely the one you expect... (The "third behavior" is the `delete-frame' option.) As I understand things, both the `kill-terminal' and `delete-frame' options were added to support my mental model in particular (we were the only two people commenting on the bug at that time). From my perspective, `kill-terminal` (and now `kill-last-terminal' as well) are just the result of some miscommunication between the two of us in bug#51377. Unless there's a strong argument for keeping them around, I think it would be best to remove them so that there are only 2 options (well, 3 if you include the default behavior). I hope the above explains things reasonably thoroughly for everyone (hence all the citations to previous discussions). If pressed, I could probably create a full specification of the behavior I'd like to see, but I find it quite a bit easier to explain by way of a patch. If anyone needs clarification on any of the above, just let me know and I'll try to elaborate. [1] https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01465.html [2] https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02163.html [3] https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02207.html [4] https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02367.html [5] https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02373.html From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 15:37:10 2021 Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 20:37:10 +0000 Received: from localhost ([127.0.0.1]:52344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpcXO-0005B6-9F for submit@debbugs.gnu.org; Tue, 23 Nov 2021 15:37:10 -0500 Received: from heytings.org ([95.142.160.155]:46418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpcXK-0005Aw-PF for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 15:37:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1637699825; bh=aYShTjc2Ra1ChBBptYGsIIBDNnODmTfB0X4HfrLVZ8E=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=LDjq6nelwfMiKR5IXdMBeJIl7gVz5mAmxVXXaI4jtfPt6Acaw5A+xDaIhJYPta9GN 73Df0X8mK7t8SE2Z6xYRbjBlzmDw0Ls1ar125EO1ogdr3qOnebVVrMTuoQF1MT3gNB CA94QHAKsrVEcTQq6nPrukmZVLj0HR5xz+UNZLaKPjPTpcMyOzKqjJ4iV2Vhedc5l+ AuW/eQg9l3X6Ax31B54qvOdXoKLQ0Euu3ANRx3pVR/3SL5RlukaknT1f3ZA0HSTU9/ s0TNCnhszdxwHnBREIaL4aakaSuEVGGlSAHeJy1ExRfXdxPwV9m/0KjlG75hVdtyno oby+tuZL78ijw== Date: Tue, 23 Nov 2021 20:37:04 +0000 From: Gregory Heytings To: Jim Porter Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files In-Reply-To: <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> Message-ID: <890d44ded2fa8ff77ab2@heytings.org> References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: Eli Zaretskii , 51993@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> This is not a bug, this is the intented behavior of that feature > > I started that discussion (and participated throughout it), and I don't > think we actually agreed that this was the intended behavior. > This is the behavior I intended (and described in the docstring and manual), if you prefer. And you did not make further comments in bug#51377, which can be interpreted as a kind of agreement. > > I should stress that the case I brought up above is just a > counterexample to show a problem with a previous implementation strategy > Which problem? > > The current behavior on Emacs 29 certainly isn't what I personally > intended when bringing the idea up on emacs-devel. > Is the current behavior of Emacs 29 with my patch and (server-stop-automatically 'kill-terminal) still not what you want? If not, what is missing? > > I'm concerned that we're now up to 4 different behaviors, when I think > two of them are just the result of a miscommunication between the two of > us. > They are not, AFAICS. The four behaviors are four reasonable options, each of which can (and is) described in a short paragraph, and corresponds to a different user preference. I see no reason to remove any of the current three behaviors because of an unspecified "problem". Especially given that all these behaviors are implemented in only ~50 lines of Lisp. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 17:08:15 2021 Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 22:08:15 +0000 Received: from localhost ([127.0.0.1]:52426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpdxX-0007kf-CJ for submit@debbugs.gnu.org; Tue, 23 Nov 2021 17:08:15 -0500 Received: from mail-pf1-f170.google.com ([209.85.210.170]:46730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpdxV-0007kO-4O for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 17:08:13 -0500 Received: by mail-pf1-f170.google.com with SMTP id o4so595677pfp.13 for <51993@debbugs.gnu.org>; Tue, 23 Nov 2021 14:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ByiTuqy4zaXIHUWAxwSNnYzxRs9+PcPl/HMC1u3V2/U=; b=n9TaSxgB3UG+N+EHU0uqVEwsTPo2UW24IlIdTotuXBR4C0jZXhFVpRfAub14ZtZ6Qu Po1whVJplvbS9+5A8FOrKJ0VPrBw19I1rIVShyQwA1EcezHHmf6essFDUM+65jT61CUS UfDG6DNeWxfUGIVSsS+eDg8lVWcVOfaeV6l5YaUXlmGpSzoFaho+zficjPGvlIsqz044 hPiPN+61R/6ZXT2PPPwqMbtVp8pTHpByfSvaSWchQjPEWlXjqGZIbRV0Vq1ZckVTaU8+ l6a9BLBNPIjgcs+gO4rCb2URXUaOkmyI2T+jsNDhq7CWVJ/WNWd0XbSigbpChs/aiDMQ cCXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ByiTuqy4zaXIHUWAxwSNnYzxRs9+PcPl/HMC1u3V2/U=; b=JftQ+3xNon62QJBjGxthhxwBCtMV4kUeGRL8uh/fS86nVVxDeG4MKw1IYBtance7/o /w6IFg0TVI0NXONokbyxPWBSxPTY19RPHth8vz9rwvssioYSq+9BkI1TfBjUe+SGoo4L gg/x6deW+tGa/4w2JepxjcdKxK2kzBOawE8U4gNNwe9Qj0VKxtVZm1Owh7n3ygrCJxA3 +Zsl0UV18tGlwTssEte0K8JoWJTMCXZOLQ+/N4TA/n+S//hUqWL+vLVhE/FVkkwAjvsS TgijyDfcvJ7OcL+LzlXFxhK+pxyej4S8GdSeG5skwtJxCRX2wJiB8TlmagZpQfPLx0Pc j3hw== X-Gm-Message-State: AOAM530zLFrNWzURV52EOac+06vKKHLtlrQ6ERfCdtuM9IaSvCYxYeTH 05UF7OMVg8y30mi8WWULYLo= X-Google-Smtp-Source: ABdhPJzLUgZC/fW8GfhDNKxIudIvSn6CIUk8rbtfIgVuY0BvdXVtBFuHVKX9O3mvEEkKL74yhQ1aiQ== X-Received: by 2002:a05:6a00:140c:b0:447:96be:2ade with SMTP id l12-20020a056a00140c00b0044796be2ademr820363pfu.26.1637705287271; Tue, 23 Nov 2021 14:08:07 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id c10sm6431399pgk.84.2021.11.23.14.08.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Nov 2021 14:08:06 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: Gregory Heytings References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> <890d44ded2fa8ff77ab2@heytings.org> From: Jim Porter Message-ID: <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> Date: Tue, 23 Nov 2021 14:08:05 -0800 MIME-Version: 1.0 In-Reply-To: <890d44ded2fa8ff77ab2@heytings.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11/23/2021 12:37 PM, Gregory Heytings wrote: > >>> This is not a bug, this is the intented behavior of that feature >> >> I started that discussion (and participated throughout it), and I >> don't think we actually agreed that this was the intended behavior. >> > > This is the behavior I intended (and described in the docstring and > manual), if you prefer.  And you did not make further comments in > bug#51377, which can be interpreted as a kind of agreement. Unfortunately, I was sidetracked by other things and didn't have a chance to comment before Lars merged the patch. Since it had already been merged, I thought it best to follow up in a separate bug once I had made concise steps to reproduce the issue and a patch to fix it. >> I should stress that the case I brought up above is just a >> counterexample to show a problem with a previous implementation strategy >> > > Which problem? Prior to that comment, your proposed implementation would kill Emacs on a timer when there were no non-daemon frames left, which could result in unsaved changes to files being lost. I replied to point that out and showed some steps to reproduce it: . >> The current behavior on Emacs 29 certainly isn't what I personally >> intended when bringing the idea up on emacs-devel. >> > > Is the current behavior of Emacs 29 with my patch and > (server-stop-automatically 'kill-terminal) still not what you want?  If > not, what is missing? If I'm understanding your patch, the behavior I'm looking for is essentially a combination of `kill-terminal' and `delete-last-frame'. I may be misunderstanding it though, since the call tree in your patch confuses me a bit: with `kill-terminal', `server-save-buffers-kill-terminal` calls `server-stop-automatically--handle-delete-frame', which then calls `server-save-buffers-kill-terminal' again. One of my other goals in my patch was to simplify the logic in `server-save-buffers-kill-terminal' and `server-stop-automatically--handle-delete-frame' somewhat. Rather than to have `server-stop-automatically--handle-delete-frame' check if it was called by `save-buffers-kill-terminal', I found that the implementation was simpler (to me, anyway) if that logic was lifted up into `server-save-buffers-kill-terminal'. One benefit of this simplification is that it causes fewer changes in behavior compared to not using `server-stop-automatically'. For example, normally when a user kills an emacsclient terminal, Emacs will prompt about saving files *before* deleting any frames. This is nice because it allows the user to back out by pressing C-g, leaving Emacs in (almost) the same state it was previously. My patch handles that and allows the user to press C-g and leave all the current frames open. With your patch in this bug, using `kill-terminal' and pressing C-x C-c will close all frames for the current client but the current one, and only then prompt the user to save buffers. Thus, pressing C-g will leave the user with only that last client frame still open. (Note: to test this behavior, you probably need multiple clients open as I outlined in the first post to this bug.) >> I'm concerned that we're now up to 4 different behaviors, when I think >> two of them are just the result of a miscommunication between the two >> of us. > > They are not, AFAICS.  The four behaviors are four reasonable options, > each of which can (and is) described in a short paragraph, and > corresponds to a different user preference.  I see no reason to remove > any of the current three behaviors because of an unspecified "problem". > Especially given that all these behaviors are implemented in only ~50 > lines of Lisp. I've specified the problems. I can try to clarify if there's any confusion though. This bug is one such problem. I don't think that a user who opts in to stopping the Emacs daemon automatically is *also* opting in to changing the behavior of whether Emacs will prompt about saving files when killing a (non-last) client. Since there are other clients, the daemon won't be killed, and so the behavior should be identical to what happens without `server-stop-automatically'. As a user, I would find it very strange that enabling `server-stop-automatically' would change Emacs' behavior in ways *other than* stopping the server in certain cases. Of course, a user may indeed want to be able to kill a client (but not the daemon) without being prompted to save files, but I think that's independent of whether the daemon should be stopped when the last client exits. If users *do* want this behavior, we could add a totally separate option for it; this would allow users who don't want to be prompted but also don't want `server-stop-automatically' to use it. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 17:49:57 2021 Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 22:49:57 +0000 Received: from localhost ([127.0.0.1]:52441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpebs-0000UW-OT for submit@debbugs.gnu.org; Tue, 23 Nov 2021 17:49:57 -0500 Received: from heytings.org ([95.142.160.155]:46530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpebn-0000UE-8z for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 17:49:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1637707789; bh=Je/vPRoE019wI1Py0bF3po4+WZIr+AhRe6TFd8MyoG0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=wTl81R51BjkuqTFbWDCgPI5WILNXUSBYf+t8jr3QrKMzk4pa+YtgnH9kT3YztkijW Xv/pt7N21xkyTaUIZZnp+zPA2nSiebo519kTobj6pZ/fiUvCZb9fO/94ZWfeqP92/0 AxjJZcevV8M7jKuc9a+4CopcKEID3UGGL38TFFqirxalv8rXg2BllcuP62iF8m/hlu GuJwgC9+r6eQIkse/AzhQ7GzFuDKllIRKENWSAIdPE6Vag31sWAuWlTu1sKpdwwt+V c6WG1ErFG/YN1ZqsB3KC/f1MIeHGASz+opfXh+monnivzlRMgyde4n09ppr46FpNTe aoGlbcXD7UOXA== Date: Tue, 23 Nov 2021 22:49:49 +0000 From: Gregory Heytings To: Jim Porter Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files In-Reply-To: <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> Message-ID: <890d44ded2c42fe531a1@heytings.org> References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> <890d44ded2fa8ff77ab2@heytings.org> <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>> I should stress that the case I brought up above is just a >>> counterexample to show a problem with a previous implementation >>> strategy >> >> Which problem? > > Prior to that comment, your proposed implementation would kill Emacs on > a timer when there were no non-daemon frames left, which could result in > unsaved changes to files being lost. I replied to point that out and > showed some steps to reproduce it: > . > I don't think it's useful to discuss a problem that was raised and fixed a month ago. > > If I'm understanding your patch, the behavior I'm looking for is > essentially a combination of `kill-terminal' and `delete-last-frame'. > If so, a fifth behavior could be implemented. But you would have to describe what you want, and it should be something reasonable. Could you please do that, and explain what you want when: 1. You delete a frame that is not the last one 2. You delete the last frame 3. You kill a terminal that is not the last one 4. You kill a terminal that is the last one > > I've specified the problems. I can try to clarify if there's any > confusion though. This bug is one such problem. > As I said earlier, the problem you described in this bug report was not a bug, at least in the sense that it was not something that was not explicitly intended by the one who wrote the code (and documented). And the behavior you wanted is handled by the patch I sent, without removing any of the other existing behaviors. But now you apparently want something else again. > > I don't think that a user who opts in to stopping the Emacs daemon > automatically is *also* opting in to changing the behavior of whether > Emacs will prompt about saving files when killing a (non-last) client. > Since there are other clients, the daemon won't be killed, and so the > behavior should be identical to what happens without > `server-stop-automatically'. As a user, I would find it very strange > that enabling `server-stop-automatically' would change Emacs' behavior > in ways *other than* stopping the server in certain cases. > Yet this is what you're asking. If you want Emacs to prompt you whether the files should be saved and the process killed when you delete the last frame, you want to change the way Emacs prompts about saving files and killing processes, because this (namely prompting the user when the last frame is deleted) isn't happening without server-stop-automatically. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 18:43:12 2021 Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 23:43:12 +0000 Received: from localhost ([127.0.0.1]:52486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpfRP-0001z3-Gk for submit@debbugs.gnu.org; Tue, 23 Nov 2021 18:43:11 -0500 Received: from mail-pl1-f182.google.com ([209.85.214.182]:34710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpfRK-0001yZ-K5 for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 18:43:10 -0500 Received: by mail-pl1-f182.google.com with SMTP id y8so379069plg.1 for <51993@debbugs.gnu.org>; Tue, 23 Nov 2021 15:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=rrbgTcy2IYLhsGr+wKvPJOxDfopj96nUkWYjIPbu0WY=; b=QDWF1uNtewAhydTXa8JzL5dEk1pUlgUIXYk2aO3EE9/CUh6no4Lo0H6c735nz98N+t zSqKf/1sQDCia/sbOYMamdIMiOx04P0cDYUnIrvyinfVptEyU3N4uER0IsN1btiSINxZ 2MG/+NXOPwVb+ZdFPTeSfFC9ouu29qkLsKsAwnmAXicdwLWCmZUMBWNSLg1Fn9mxxw81 yZqjS3ZNbWtrux9Q2dxZ6jp3TLm3NcurIXjl21aAd36nusIa9HFYXfufruNbsFJapbsr /JIGWXxECmzH7azxMxfGN46v6V/iB7fyy4gxxzlgmddk364u2kTLITgCK4rdY3zxZBO7 SgdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rrbgTcy2IYLhsGr+wKvPJOxDfopj96nUkWYjIPbu0WY=; b=QRoVQDOkX7mnsKYMZUZO86Ds9iY47XYL2za6+QR7NG5qgt5EPKp3JH+y0WA2DOoMEW iP49zu0FQuveyMzbTiKAWHl1HrB0ZQoYC050OpHleBPpHtP9s6mYSQFCdXgcS5qs2WfY Ku7ZNyhlxRvIEZRrk7nm8bVjZ8GHDQehgBjwcnXkcinI2q7dBxWM/o/7GcJCpoFrS9Ii EcmV8yqsCuukRMdtQZ54EcoYXsiWg0sxFm8uBYe87ROh+fX6wcW7P2dBD9jqocxBoKXU PY8eNrT/xluC1SNmaJ99ZHEGNzjX+n+0+tOA08g+fce56/3A+tBs+gD5UvGvHrQ6A6kB buQg== X-Gm-Message-State: AOAM530zBxSTOqBqW0wBfJNT1Ql77T9Egnd98xAxSt610XP0geqPofJy ex5VkvkZyzTaOfmOHaRexy0= X-Google-Smtp-Source: ABdhPJy4kii9aRP+VcOMA4KgXk9IU6Gr0EduJtFSram0hE9A+I1kHokg+EWTFcNaKFQjNZGbOpd2XQ== X-Received: by 2002:a17:902:7616:b0:143:a8cd:ef0 with SMTP id k22-20020a170902761600b00143a8cd0ef0mr12323600pll.48.1637710980721; Tue, 23 Nov 2021 15:43:00 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id t3sm7661440pfg.94.2021.11.23.15.42.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Nov 2021 15:43:00 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: Gregory Heytings References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> <890d44ded2fa8ff77ab2@heytings.org> <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> <890d44ded2c42fe531a1@heytings.org> From: Jim Porter Message-ID: <60d6439a-d2be-cbb4-b979-312a35216758@gmail.com> Date: Tue, 23 Nov 2021 15:42:59 -0800 MIME-Version: 1.0 In-Reply-To: <890d44ded2c42fe531a1@heytings.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli, Lars: I'm not sure what either of you would like to do about this bug, but it seems that most of the conflict is due to a miscommunication between me and Gregory (that's my impression, anyway). I hope my previous messages have explained my thoughts on the matter fairly thoroughly (if not, just let me know). However, I'm not sure there's much more I can add to the discussion beyond this message. On 11/23/2021 2:49 PM, Gregory Heytings wrote: > As I said earlier, the problem you described in this bug report was not > a bug, at least in the sense that it was not something that was not > explicitly intended by the one who wrote the code (and documented).  And > the behavior you wanted is handled by the patch I sent, without removing > any of the other existing behaviors.  But now you apparently want > something else again. I've only wanted one behavior since I started this discussion on Oct 19[1]. However, rather than making sure we understand each other's descriptions (or consulting the patches I've posted throughout the discussion) and have properly identified the corner cases to handle, you've instead implemented the behavior "for" me, even though I said from the beginning that I was looking to write the patch myself. I never posted a rigorous specification of the behavior I wanted for that reason: I was soliciting feedback to develop a patch that meets my needs (along with the needs of anyone who spoke up at the time, if possible). The fact that you opted to help by authoring your own patches is appreciated, but it ultimately doesn't help me because we seem to be talking at cross purposes and your impressions of what I want aren't what I actually want. Moreover, if our interpretations *don't* match up and I bring up an issue with a proposed patch, that doesn't mean that I want an additional option or that I've changed my mind; it just means that we haven't reached an understanding yet. I certainly don't expect you to do any additional work here. I'm perfectly happy to provide patches implementing the behavior I have in mind, and to adjust them as needed if you or anyone else has feedback on them. While I could probably construct a rigorous specification for the behavior I want so that someone else (e.g. you) could implement it, that would probably end up just being a set of test cases extracted from the patch I already have. As an aside, I mentioned this previously, but I think it would be valuable to write some automated test cases to verify that things work as expected. However, I didn't see a way to test creating/destroying Emacs servers/clients via ERT. I'm certainly open to doing so if someone points me in the right direction though. >> I don't think that a user who opts in to stopping the Emacs daemon >> automatically is *also* opting in to changing the behavior of whether >> Emacs will prompt about saving files when killing a (non-last) client. >> Since there are other clients, the daemon won't be killed, and so the >> behavior should be identical to what happens without >> `server-stop-automatically'. As a user, I would find it very strange >> that enabling `server-stop-automatically' would change Emacs' behavior >> in ways *other than* stopping the server in certain cases. >> > > Yet this is what you're asking.  If you want Emacs to prompt you whether > the files should be saved and the process killed when you delete the > last frame, you want to change the way Emacs prompts about saving files > and killing processes, because this (namely prompting the user when the > last frame is deleted) isn't happening without server-stop-automatically. That's not relevant to the case I'm discussing above. I specifically said I'm talking about the behavior when killing the *non-last* client. In that case, the server won't be stopped, no matter how `server-stop-automatically' is configured. [1] https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01465.html From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 18:59:45 2021 Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 23:59:45 +0000 Received: from localhost ([127.0.0.1]:52495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpfhQ-0002Rs-QC for submit@debbugs.gnu.org; Tue, 23 Nov 2021 18:59:44 -0500 Received: from heytings.org ([95.142.160.155]:46630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpfhP-0002Rh-3a for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 18:59:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1637711981; bh=wtZE6CNSOc20pwwAHAtTFgQV41PSqKHeNZ0m+Ow5mIQ=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=L45z7UzYpsrGi2kEWFUUDKGOaq7V2VrldsIVFRWzFRdzvM96vIm5rwKv4ajKIJny3 gzs9mDdOEyfks3FNWmWdqnRuG1RmPY5dcxFboRP6A2yE5D1/QmZR6iygduKX7rnAk5 60zaYemNT+4uPWyayi46udI7iYEVy5gWbhrtJRjpWJxvbaasVRmahzwx4lHzfsO+X3 H4dyspcdnH0FSJUXLnUs7Mr9j7KeH7Ye6REMpYoM1AbOVS+BlGvauVDi1KnEuCNVPh 7SN789fUGYkmfkkVGTWYACxsFdmoxokMMmI1UqRVfoVLItmuU6KGt+pKSnkj4v4TiE xYud3r6ftjkuQ== Date: Tue, 23 Nov 2021 23:59:41 +0000 From: Gregory Heytings To: Jim Porter Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files In-Reply-To: <60d6439a-d2be-cbb4-b979-312a35216758@gmail.com> Message-ID: <890d44ded244c5e34000@heytings.org> References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> <890d44ded2fa8ff77ab2@heytings.org> <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> <890d44ded2c42fe531a1@heytings.org> <60d6439a-d2be-cbb4-b979-312a35216758@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > I never posted a rigorous specification of the behavior I wanted for > that reason: I was soliciting feedback to develop a patch that meets my > needs. > That's not what you did, you posted a patch claiming that one of the existing behaviors had a bug and should be replaced with another one. > > you've instead implemented the behavior "for" me > That's not what I did, I tried to implement a function that provides different possible behaviors corresponding to different needs and expectations, not just the behavior you expected. And I did this based on your feedback, what others said on emacs-devel, and my own feelings. I hoped (and thought until today) that the behavior you expected was one of them. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 23 20:10:48 2021 Received: (at 51993) by debbugs.gnu.org; 24 Nov 2021 01:10:48 +0000 Received: from localhost ([127.0.0.1]:52539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpgoB-0004Fy-Lh for submit@debbugs.gnu.org; Tue, 23 Nov 2021 20:10:48 -0500 Received: from mail-pg1-f176.google.com ([209.85.215.176]:38824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpgo9-0004Fg-Kq for 51993@debbugs.gnu.org; Tue, 23 Nov 2021 20:10:46 -0500 Received: by mail-pg1-f176.google.com with SMTP id s137so605674pgs.5 for <51993@debbugs.gnu.org>; Tue, 23 Nov 2021 17:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=4sAkP+lYFd8DZvUREODwrzqcwJLKX9sFdE+xkO6XHc0=; b=ICyWSEaZgRcNkt2Mhxq098y9F92dTj8a5Q6ZmfQbmH5krEUSs1tSU1XQqoSxbafoPJ vclCvt8X6qolQEpLjEQkB3TFYWAeFCAgjgQjqpxY+B5jD229hRHJT6dOGfAsXkndeq+S XWNovrphiSpDZYz4iiXupbSLQiBFmrkx8e2xUWL/0yvmRNkii8hIK3BxIfAECLl7/Ut0 lPyLlgSkIVwmn2j0FnD1YPjcRVQCjrHNfUIwmbxV02nSqiiOjsCIYlZdtkNbhz/kT3Ol jDc6y0330/D+SpHkL5MBdx7n9+dfBYPwt/yS5LRkeucZJ8hGjCVMBSIHG6q1sBkrYlyX bCgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4sAkP+lYFd8DZvUREODwrzqcwJLKX9sFdE+xkO6XHc0=; b=mcS3ABzDBHn33f2dNDooQg40rGicLocyn06XYrS4glqrdqlCywMTvxkvO7B96QQx0E YVfCTe7yp0cbF/ykjWlz17pncB2x1xOh2/OeGqVBxmsbmPKLtvkiWbMb4eREKcK5UiBj XYvg6vy2wAEu5Eq2phRAVylmwZn4H5I2hVQoJEOncnPaaeOboEr1PAQTm7+4PORY3B6s yW1w9qXKqWoSItP8ShRfZr4NHLQHJnXsrqYDlQ7H8TTTUPoVOtDlryMC/cK9PsAHV0rS Y1NotSbHTVszYUmSp54Pke4g/4UnkGiY5GRCAuFZulcUGCdJ4TVAsiqmRMOKPMiz345u M+MQ== X-Gm-Message-State: AOAM532qM0Cv3iOmV1UH76rDk//TaWtc+Lq8N9CpmeUphcdTHLklNa3y 0t6sHHB22YZYegjm46EhLLHaXWNr3CI= X-Google-Smtp-Source: ABdhPJzdcrY7UkdBaxJXr6ZdE5Mud0qT75EYTZETU31+Dgz7UVQZMGJCf/R7Vl0aSnU+E0W4VKPgWQ== X-Received: by 2002:a65:6554:: with SMTP id a20mr6982634pgw.107.1637716239693; Tue, 23 Nov 2021 17:10:39 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id t10sm1087888pga.6.2021.11.23.17.10.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Nov 2021 17:10:39 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: Gregory Heytings References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <83pmqvti49.fsf@gnu.org> <890d44ded2b56811ceff@heytings.org> <64c7eb70-d941-9c98-4513-a2bdc44e7953@gmail.com> <890d44ded2fa8ff77ab2@heytings.org> <1623621b-d2a6-a68c-ac28-cdd371886b11@gmail.com> <890d44ded2c42fe531a1@heytings.org> <60d6439a-d2be-cbb4-b979-312a35216758@gmail.com> <890d44ded244c5e34000@heytings.org> From: Jim Porter Message-ID: Date: Tue, 23 Nov 2021 17:10:38 -0800 MIME-Version: 1.0 In-Reply-To: <890d44ded244c5e34000@heytings.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, eliz@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11/23/2021 3:59 PM, Gregory Heytings wrote: >> >> I never posted a rigorous specification of the behavior I wanted for >> that reason: I was soliciting feedback to develop a patch that meets >> my needs. >> > > That's not what you did, you posted a patch claiming that one of the > existing behaviors had a bug and should be replaced with another one. That's in reference to my original message on Oct 19[1], which I cited earlier in the paragraph that you excerpted the quote from. At the time, I said: > I didn't see any options to configure this behavior in Emacs, but > looking over the code, it shouldn't be that hard for me to write a patch > to add this as an option. Before I started though, I wanted to see what > others thought. Is this a behavior others would be interested in? If so, > are there any other particulars I should take into account in my patch? -------------------- On 11/23/2021 3:59 PM, Gregory Heytings wrote: >> you've instead implemented the behavior "for" me >> > > That's not what I did, I tried to implement a function that provides > different possible behaviors corresponding to different needs and > expectations, not just the behavior you expected.  And I did this based > on your feedback, what others said on emacs-devel, and my own feelings. > I hoped (and thought until today) that the behavior you expected was one > of them. And that's fine. I have no issue supporting behaviors other than the one I personally want. (For example, I have no problem with the `empty' behavior, even though I wouldn't personally find it useful.) However, I also want to be sure that we don't provide *unnecessarily* many options here, since that adds to the maintenance burden and may produce unexpected behavior for users if they don't quite understand the distinction between each possible setting. In this case, I think it's better to continue prompting users when killing a non-last client just like Emacs 28[2] does. There might be some value in avoiding that prompt, but I think a user who *doesn't* use `server-stop-automatically' is just as likely to want that behavior, so if we want to support that, we should provide a separate configuration option to do so. In particular, I think it's valuable to prompt users in this case because it comes up when using emacsclient and committing code. If I set `EDITOR="emacsclient -c"' and run `git commit', then under Emacs 28, I can close the client with `C-x C-c'[3] and it will prompt me if I forgot to save the commit message. That's useful because without the prompt, it would (usually) just abort the commit due to an empty message. I think that behavior is worth preserving. (Likewise, I think it's worth preserving the ability to keep all your open frames by pressing C-g if Emacs prompts you about saving files when you try to kill a client.) Thus, I implemented the patch that you can see in the original message. -------------------- In addition, I'm not certain that we need both `delete-frame' (or `delete-last-frame' as it's called in your latest patch) and `kill-terminal'. The only difference between the two is that in the former, individually closing the last non-daemon frame (e.g. by `C-x 5 0' or clicking the X on the frame's titlebar) also kills the daemon. I prefer the behavior of `delete-frame', since my mental model is that the daemon should be killed *whenever* the last non-daemon frame is closed, no matter *how* it's closed. Maybe someone has a strong opinion in the other direction and actively wants the `kill-terminal' behavior instead. I don't have a problem with keeping that option around if someone would actually use it, but I'm skeptical of that. In this case though, I'm happy to present my argument and then defer to the Emacs maintainers to make the final call, whatever that may be. If it stays, that's fine with me; if it goes, that's fine too. -------------------- Since, as you mentioned before, we have different mental models for how this works, I'm mainly trying to explain through both prose and patches how this should work under my mental model. If I understand your prior messages correctly, your mental model is best encapsulated by the `empty' configuration. I'm 100% happy to keep that around as-is, even though it's not my preferred solution. However, my preferred solution is "something close to `delete-frame'". Your patch in bug#51377 gets most of the way to what I wanted, but there are a couple of corner cases that don't work like I expect, hence this bug. Whether the behavior is a true "bug", a miscommunication, or something else doesn't matter much to me. All I'm looking for is something along the following lines (note: this isn't 100% rigorous, so don't take it as a precise specification): 1) When killing a non-last client (including by closing the last of its frames), the behavior should be exactly the same as the default emacsclient behavior. (That's what this bug is about.) 2) When killing the last client (including by closing the last of its frames), the behavior should be exactly the same as killing Emacs when *not* using a server. (Roughly speaking, that means calling `save-buffers-kill-emacs'. It would also be nice to have an option to silence the "This Emacs session has clients; exit anyway?" prompt, though I can certainly understand others wanting to keep it around in this case.) Again, that may not be 100% precise, but it's the mental model I've used while implementing patches for this on my end. The specific implementation I use has shifted somewhat over time as I find corner cases, and also through consulting your patches. Using `delete-frame-functions' as in your code greatly simplified my implementation, for example. Thanks for that. Hopefully my delays in following up on bug#51377 haven't been *too* disruptive. As mentioned, I was unfortunately too busy to devote sufficient time to it back then (my plan when posting to emacs-devel was just to collect feedback and to work on the implementation slowly over the next several weeks). Now my schedule is a bit less hectic, and I'm hoping to address the last few concerns I had after taking the time to test things out more thoroughly. I'm certainly not trying to step on your toes or undo your patch. Just to account for certain corner cases that I didn't have a chance to investigate (or resolve) at the time. [1] https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01465.html [2] Or without `server-stop-automatically' [3] You could also use `C-x #' here, but I find `C-x C-c' easier to type, so prefer the latter in cases where either would do what I want. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 29 00:39:55 2021 Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 05:39:55 +0000 Received: from localhost ([127.0.0.1]:36747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrZON-0002JX-7O for submit@debbugs.gnu.org; Mon, 29 Nov 2021 00:39:55 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:34369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrZOK-0002JJ-VF for 51993@debbugs.gnu.org; Mon, 29 Nov 2021 00:39:53 -0500 Received: by mail-pj1-f45.google.com with SMTP id j5-20020a17090a318500b001a6c749e697so11041060pjb.1 for <51993@debbugs.gnu.org>; Sun, 28 Nov 2021 21:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:references:cc:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=TcOD8gV4/1F8u3Gq3ZX7Z1KPjVlcHDIyh2ZALQwH8OY=; b=Z5mx6e1k5f14ncuMTuv1h7ovNtP/7IYS9BT798q9xZozpMgUp+woWhQivYqXIH4fba 1MxZ5bfnyaTl7KhL8XEO6ugkoYHOpfIndbDxDcXyFowZDXupeJUU4v4zkQFIAwTvTBwf oLTB4ddZs3AkKe14BPBphm0RjgLlA4XbNcMdIyKRmSKIO3XrKd47geQS4vCQaZ2EqmO6 dMATRzXQuHPycPJDM2Kt+6F42hlhzJwiV0scRfsXRkjFtVPWmxjsLZJzX4ihFLHPsJtK pmELJ4cfgA52x83ofurHS+y+iGhANzyUp2SigS0WWNDrX1fLXVB3wPfT/RW9EiutY/fj D0Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:references:cc:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=TcOD8gV4/1F8u3Gq3ZX7Z1KPjVlcHDIyh2ZALQwH8OY=; b=7GDTn8pmAPAZa1LfttJLfID6XVHuU9XRkaCFNY/rxMgvo8xEZEtpwriZs7W3OLZbh/ dIvzOLoav+bpW+n/FiS+y5SHwKCkcN0tDNJc08nLN38LjBj9AA+tbn6bp0WAL9ftbBVc n7sxI6Fj8cvH/XkFzQrPUNADBjbZ0iWAgl7UdvbRPrr+SvJIoVW0Jzqc7wk3GfZLhxtN v953I9GkW2h7bzfwYdKisQ0uz/7K7YmyslsRT3WShR9JBboWr8lZdeoPzDoSprTU0A9Q 6z91WbRUm+hrkrWe3JcM3reqxMJT8AW7qwSYT2aku1ycG179XsPUVl3EVZ9vDo/mSPTZ hquA== X-Gm-Message-State: AOAM533nzRX0G0IRaIedAthFPug/beeTIjP9lDtSS5XRFO2SZd6CfeIP pLzsJ+EHbGERrLWYy1XfoPD1Leufa0E= X-Google-Smtp-Source: ABdhPJw0EZ1YBRrnhIg1DGfkP6LRndjmj60XCivxZVNsrP/4pQ4LJCP9t1OHA8/fuxtzIzsCxqjfJg== X-Received: by 2002:a17:90a:e012:: with SMTP id u18mr36206450pjy.103.1638164386992; Sun, 28 Nov 2021 21:39:46 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id 7sm11224503pgk.55.2021.11.28.21.39.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 28 Nov 2021 21:39:46 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files From: Jim Porter To: 51993@debbugs.gnu.org References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> Message-ID: <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> Date: Sun, 28 Nov 2021 21:39:46 -0800 MIME-Version: 1.0 In-Reply-To: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: eliz@gnu.org, gregory@heytings.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) To help move things along, I've drafted an initial version of a proposal describing possible behaviors of `server-stop-automatically' at a high level. Hopefully that will make it easier to discuss how each setting should work, and we can refine the proposal until we're happy with it. Then any implementation changes should "just" be a matter of following the final proposal. I welcome any comments or suggested additions to this proposal. I covered things how I see them, but I may not have provided enough detail for everyone to understand all the nuances, and other people might have their own use cases they'd like to see addressed. I can also post this proposal to emacs-devel if people think it would be better to get a wider range of feedback on it. Once we can get some level of consensus on the proposal, then hopefully we'll know the right thing to do about this bug. -------------------- Automatically Shutting Down the Emacs Daemon Revision 1 * Introduction Since Emacs 23, `emacsclient' has had the ability to automatically start an Emacs daemon by passing `--alternate-editor=""' (or setting the ALTERNATE_EDITOR environment variable to the empty string). In Emacs 29, the ability to automatically shut down the daemon was added for symmetry. This allows users who prefer to start the Emacs daemon on an as-needed basis to configure the daemon to stop when finished. However, "finished" is a vague term and doesn't precisely describe the conditions that would cause the Emacs daemon to be shut down. Note: for the discussion below, "clients" refers to both "true clients" (members of `server-clients') and "pseudo-clients" (each frame with the `client' parameter set to `nowait'). This is essentially the logic used by `server-save-buffers-kill-terminal' since Emacs 23. * Proposed Behaviors I propose two main ways of determining when the Emacs daemon should be shut down automatically. Each has different pros and cons, and so there are arguments for supporting one, both, or neither in Emacs going forward. However, I think each are distinct enough that supporting both would be reasonable. ** Implicit Shutdown For this behavior, the Emacs daemon will be silently stopped once nothing would be lost by stopping it. In particular, this means that the Emacs daemon should continue so long as there's at least one a) active client, b) unsaved file, or c) running subprocess (with non-nil `process-query-on-exit-flag'). If none of these exist, then the Emacs daemon will be stopped. One open question is how this should interact with options that control how `save-buffers-kill-emacs' prompts the user. If `confirm-kill-processes' is nil, should the Emacs daemon then be stopped even if there are active subprocesses? *** Pros A benefit of this behavior is that because the shutdown occurs implicitly, there's no change to how users interact with Emacs. For example, `save-buffers-kill-terminal' will prompt the user to save only those files passed to `emacsclient'. *** Cons However, the behavior's benefit has another side to it: it can be difficult for a user to predict whether the Emacs daemon will be stopped. For example, a stray unsaved file that the user forgot about could be the difference between the daemon continuing to run or being stopped. Furthermore, since an Emacs daemon with no clients is out of sight, it may be some time before the user realizes their mistake, leading to confusion about why some other program appears to be reading an out-of-date version of the file. That said, this aspect is equally a concern when *not* automatically stopping the Emacs daemon at all. ** Explicit Shutdown (Note: this is the behavior I personally prefer.) In this case, Emacs will be stopped as soon as there are no active clients, prompting the user to save their work as needed. In other words, when a client is about to be deleted for any reason (calling `server-save-buffers-kill-terminal', deleting the last frame associated with the client, etc), then: - If this is not the last client, behave as in Emacs 28; that is, prompt to save any files passed to `emacsclient' before deleting the client. - If this is the last client, prompt the user to save all their work before killing Emacs entirely; that is, call `save-buffers-kill-emacs'. In this case, the behavior should be identical (or as close as possible) to killing a "regular", non-server Emacs in a similar state. One open question is: should Emacs warn the user that it will the daemon when deleting the last client? Currently it does so in `server-kill-emacs-query-function', asking, "This Emacs session has clients; exit anyway?" It may be useful to keep this warning, possibly rewording it in this case to explain the situation better. It's also possible that it's just extra noise and should be eliminate in this case. (It may even make sense to provide a separate configuration option.) *** Pros One of the main goals with Explicit Shutdown is to resolve a concern mentioned above: an Emacs daemon with no clients is out of sight, so it's easy to forget about it. If the daemon is holding onto unsaved work, it may take a while until the user realizes this. By prompting to save *all* the user's work before closing the last client, it's much harder to make this mistake. *** Cons This behavior makes it more difficult for a user to know ahead of time whether `save-buffers-kill-terminal' (bound by default to `C-x C-c') will kill the client or Emacs entirely. The prompt mentioned above in `server-kill-emacs-query-function' does let the user bail out though, if they didn't mean to kill Emacs entirely. However, `save-buffers-kill-terminal' already has this complexity (almost), since it will kill Emacs entirely when executed from a non-client frame. That said, it's possible to tell what will happen in this case by looking at the mode line: if it starts with something like "U:@---", it's a client frame and thus an observant user will know what `save-buffers-kill-terminal' will do. * Delayed Shutdown It may also be worth considering whether the Emacs daemon should be stopped immediately when the conditions are met, or whether it would be better to delay it by a short time. Some operations, such as `git rebase -i', can open the $EDITOR, close it, and then reopen it in rapid succession. In a case like that, it would be more efficient if the Emacs daemon weren't stopped right away. That said, I don't think this is a critical problem, and believe it would be ok to decide what to do about this later. * Current Behaviors Currently, Emacs 29 supports Implicit Shutdown (called `empty') and has two slightly-different variations on Explicit Shutdown (called `kill-terminal' and `delete-frame'). `empty' is implemented as a timer that periodically calls `server-stop-automatically--maybe-kill-emacs' to check if there's any need to keep the daemon running (non-daemon frames, unsaved files, or running processes); if not, it stops the daemon. This differs very slightly from the proposed spec above, since it checks for frames, not active clients. Some clients (e.g. `emacsclient --eval FOO') don't create any frames, so it may be useful to enhance the current implementation of Implicit Shutdown to account for this. `kill-terminal' is implemented in `server-stop-automatically--handle-delete-frame' (called by `server-save-buffers-kill-terminal'). It first deletes all frames associated with the current client *except* the current one. Then, if there are any non-daemon frames aside from the current one, it just deletes that frame; if it's the last non-daemon frame, it calls `save-buffers-kill-emacs'. `delete-frame' works like `kill-terminal' above, but will also call `save-buffers-kill-emacs' when closing the last non-daemon frame using other means, such as clicking the "X" in the frame's title bar on a GUI system. As mentioned above, `kill-terminal' and `delete-frame' work similarly to the Explicit Shutdown behavior, but there are some differences. For example, when killing a non-last client, `kill-terminal' and `delete-frame' don't prompt to save files passed to `emacsclient'. When killing the last client, they delete all the non-current frames before calling `save-buffers-kill-emacs', meaning that pressing `C-g' to cancel when prompted will still result in all but one frame going away. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 29 07:41:25 2021 Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 12:41:25 +0000 Received: from localhost ([127.0.0.1]:37339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrfyH-0001Ee-AD for submit@debbugs.gnu.org; Mon, 29 Nov 2021 07:41:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrfyF-0001ES-IC for 51993@debbugs.gnu.org; Mon, 29 Nov 2021 07:41:23 -0500 Received: from [2001:470:142:3::e] (port=40046 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrfy9-0006mL-1H; Mon, 29 Nov 2021 07:41:17 -0500 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=sueJuGJh1OXscGpSZnLcfCCDFhYhOACSICvMdJI1tUo=; b=gYkWHXeyRdjw oUleroII32xz05E8ui8qdo5l5harllD2yN/UUKYDEkWZoLiEFThtmNzAaXaPzJLsHClP2KMBx1l0U moxxcbhdXAe5Hu2wGrrYOMy5H+UAnRt/TH36S+JkYv+wDbeSu8OaA/bMMqyC9cnJfZ5ZiWgQOY/Da ukR7HGUr9gL63l39PHJ+/S3xokM5ZzIUqYJS9YMXe3rDoA628LrjHWOdd6zJ5rA+qYcDXfQSxLtJ3 MOxh/umrJIgups1TE6l9hzh4UaajH/gv8qHKxPXUpINSUBfo6qD0Hf2PMJ353ytbomWaZFCv92+D3 +SA6TSQ+qpo2hhQRmsfwxw==; Received: from [87.69.77.57] (port=1416 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 1mrfy8-0002Lw-Ki; Mon, 29 Nov 2021 07:41:17 -0500 Date: Mon, 29 Nov 2021 14:41:28 +0200 Message-Id: <834k7vw2vb.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> (message from Jim Porter on Sun, 28 Nov 2021 21:39:46 -0800) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Jim Porter > Cc: eliz@gnu.org, larsi@gnus.org, gregory@heytings.org > Date: Sun, 28 Nov 2021 21:39:46 -0800 > > To help move things along, I've drafted an initial version of a proposal > describing possible behaviors of `server-stop-automatically' at a high > level. Hopefully that will make it easier to discuss how each setting > should work, and we can refine the proposal until we're happy with it. > Then any implementation changes should "just" be a matter of following > the final proposal. > > I welcome any comments or suggested additions to this proposal. I > covered things how I see them, but I may not have provided enough detail > for everyone to understand all the nuances, and other people might have > their own use cases they'd like to see addressed. > > I can also post this proposal to emacs-devel if people think it would be > better to get a wider range of feedback on it. Once we can get some > level of consensus on the proposal, then hopefully we'll know the right > thing to do about this bug. Thanks. However, I'm not sure I understand the way forward, as you see it. AFAIU, there are fundamental disagreements between you and Gregory, and I don't think the disagreements are there because one of you doesn't understand the proposals of the other. So how could these disagreements be reconciled? Either you-two come up with some compromise that is acceptable by both of you, or Lars and myself make the decision for you (and we don't guarantee you will like it), or things are left as they are now. What will it be? From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 29 08:40:12 2021 Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 13:40:12 +0000 Received: from localhost ([127.0.0.1]:37431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrgtA-0002mX-3K for submit@debbugs.gnu.org; Mon, 29 Nov 2021 08:40:12 -0500 Received: from heytings.org ([95.142.160.155]:53854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrgt8-0002mM-0a for 51993@debbugs.gnu.org; Mon, 29 Nov 2021 08:40:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1638193209; bh=+5XzbrnXjwOaLE3uwl5WqoIXGaN+3vQyAZYSKPqNBdk=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=d5M8iV5qrkOGaTE8cnSP8X+bbDty4Wv0WkRra+3BixwDoDZIbazViD1FQWoOPB63z 0OoevzSmAOVJOUvrKhdToD4baHLy6dvWlkCi93SFs4evJaoOMup5cQbZHYyd0IhaC7 7h/44/jaxtneXJSU0yQPGmDPnch0bFIBX5xkGrSKOLh9ClKB7bTa38b0xW6bZVsTKJ bEdz6Kjq/9cX7DIePMoWCLZC5ZRn5uL0g4DlUpjLxSGsb6GuBtth/U4aj73Dfp4D02 oBjhyJgq5zO476KCLKu8/f3mhYY5KvU0y2Pg9xdFypNhkkXyIVZyMRN9TIFTWs602J WgFgHbgoIAHbg== Date: Mon, 29 Nov 2021 13:40:09 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files In-Reply-To: <834k7vw2vb.fsf@gnu.org> Message-ID: References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: Jim Porter , larsi@gnus.org, 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > > However, I'm not sure I understand the way forward, as you see it. > AFAIU, there are fundamental disagreements between you and Gregory, and > I don't think the disagreements are there because one of you doesn't > understand the proposals of the other. > > So how could these disagreements be reconciled? > I'm in the process of implementing something that should satisfy everyone, but it's not finished yet. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 29 14:12:32 2021 Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 19:12:32 +0000 Received: from localhost ([127.0.0.1]:39408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrm4l-0000aw-L1 for submit@debbugs.gnu.org; Mon, 29 Nov 2021 14:12:31 -0500 Received: from mail-pj1-f44.google.com ([209.85.216.44]:36810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrm4k-0000ak-B5 for 51993@debbugs.gnu.org; Mon, 29 Nov 2021 14:12:30 -0500 Received: by mail-pj1-f44.google.com with SMTP id n15-20020a17090a160f00b001a75089daa3so16371679pja.1 for <51993@debbugs.gnu.org>; Mon, 29 Nov 2021 11:12:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=kdzVLmq/nduj45T7h0M0JK+6rh/OacwjfNxtCaKjoDQ=; b=nrhAnf20dfWZJ7kyHKRLyfbN7gEs3T6lgyJIcKlmccuWi9v88IqW1w29IXBI+QyZjj pY7Q/L48FsN5sOADAb4dePV338UURnj/ERnHr6nVo+d68Jj8+a6u0GGabtx0na3leP7p 81fAyAQOGwtzXbkzaqTcU1uKGLrxzMAtN9fAEcC+3pyC83WaaPcIOSFpBJ63Y4B24lCi DqfvG2aAY11UuaNmpUgxIk478KfAhXbEp06O5COYIsWpXCAJWWA3L1HpaCvnLsmUU5Bd bZvN38vokV8CneilCtr5hV/4WMsrbfguZSuolT1IcRl7efACcex9LRmhUbF+DJQ2f76e +alQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kdzVLmq/nduj45T7h0M0JK+6rh/OacwjfNxtCaKjoDQ=; b=Sa3SzKhqeZyUlYrVCtIYAq4H6wF57sAGGCEVZLCfojbGSMv/ciDZkrlhMpRB8Bglbq u3zb9oBQ2dndle/ajkRpWgcRvEJR0DxxHo55J6939bjFuCqaPNiXmLKrwVX6A6Bx2CDv jU0c1UYoyYKBj7k/BCI1/Ab7Xl9hlX+17H/tcwFPhIaRhm5XVOdHGTDycQQYIQipinbJ fUrfRehRch/SX6wiIr9aiArN2hjC46oPNh9pJC1EUSayMlr3Czji+46YJTYCqYEQgelz 98JG8+E7ZXp5zsSKlIbtUloNS/BcquaFuVd6xF9ud2kJbmadUrl8v9aCf9ex8m0x91ty 4MHg== X-Gm-Message-State: AOAM5334RrHhTloEwDA3HrbvMc+Cz+X12zxgl9bqg15UO47su9WH41BL jfwI8KLF/dEDB09wCY/CGP0= X-Google-Smtp-Source: ABdhPJwPAhOdBCN7QIW+Ti0aN2+ixkXANpyBw0otU+9zhIeys+EUo7eK+TkTCEu6QVYIcW8hazgMAA== X-Received: by 2002:a17:90a:d515:: with SMTP id t21mr275380pju.123.1638213144652; Mon, 29 Nov 2021 11:12:24 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id oa17sm102712pjb.37.2021.11.29.11.12.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Nov 2021 11:12:23 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> From: Jim Porter Message-ID: <514c9cb1-aa94-4332-0740-ad51310c2014@gmail.com> Date: Mon, 29 Nov 2021 11:12:22 -0800 MIME-Version: 1.0 In-Reply-To: <834k7vw2vb.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11/29/2021 4:41 AM, Eli Zaretskii wrote: > However, I'm not sure I understand the way forward, as you see it. > AFAIU, there are fundamental disagreements between you and Gregory, > and I don't think the disagreements are there because one of you > doesn't understand the proposals of the other. I think there may be some of both. Since, from Gregory's perspective I've been changing what I want, and from my perspective I've always wanted the same thing, it seems that there's at least some miscommunication happening. Hopefully my proposal helps to explain my position more clearly (and in a single message, rather than scattered across several). There may still be some disagreements, and I'm happy to incorporate anything I've missed into the proposal if people would find that useful. On the other hand, if it's easier to just work on a patch that everyone would be happy with (or at least be able to tolerate), that's ok too. > So how could these disagreements be reconciled? Either you-two come > up with some compromise that is acceptable by both of you, or Lars and > myself make the decision for you (and we don't guarantee you will like > it), or things are left as they are now. What will it be? Hopefully Gregory and I can reach a compromise; the Implicit Shutdown case in my proposal is an initial attempt at incorporating Gregory's desired behavior (it was the behavior Gregory first proposed in the thread on emacs-devel). I'm primarily interested in the Explicit Shutdown case though; I may have missed some things in that section as well, but like I said, I'm happy to add more to it if anyone has things they'd like to be added. That said, no matter if Gregory and I can reach a compromise, I think it would be helpful if you and/or Lars could take a look if you have time to be sure the behavior makes sense to you and that it's something you'd want to be in Emacs. Since this might have relevance for other Emacs features (e.g. emacsclient.desktop[1]), I think it would be good to have as many experienced eyes on this as possible. In the end, so long as everyone is clear what the behavior should be, and that it's documented as such so there's no confusion about what's a bug and what's intended behavior, then I don't have any (major) problems. Obviously, I'd be happy if my preferred behavior were a part of Emacs, but if you and Lars don't think it should be, then I can just continue what I've been doing: add advice to the necessary server.el functions in my config so things work how I like. [1] https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01846.html From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 29 14:31:35 2021 Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 19:31:35 +0000 Received: from localhost ([127.0.0.1]:39485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrmN6-0002M4-Me for submit@debbugs.gnu.org; Mon, 29 Nov 2021 14:31:35 -0500 Received: from mail-pl1-f170.google.com ([209.85.214.170]:44955) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mrmN5-0002HD-Ic for 51993@debbugs.gnu.org; Mon, 29 Nov 2021 14:31:28 -0500 Received: by mail-pl1-f170.google.com with SMTP id q17so12986878plr.11 for <51993@debbugs.gnu.org>; Mon, 29 Nov 2021 11:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language; bh=oI81EMvi2IboNe0MWS34dygN3MzS80C2az7x52yzXz0=; b=ARgjGusOgdEQe9dLnNOOo76Tf0ZCfGb8zYvRIsofFEBc9boSGVl/a6lsBo0B2RLFoA AkNN+PUoYNVj+sW8PiRKoa896nRBCfhWXAksaT2hWYyfKlomZhNjse2qV6/HjxaME+yU DoFeG+d9TRHJeLyKzgdpUSgj3mNuy3xIpilMX+JH4aR30Ilm8E1M/PnXy1Z62Lb4w8Pl qOclsLpueKyr8WdY8p4wwHwAh+kxzjE4fVfv9d/rjzIn9yL1BZL9gVyhGIioc5fGJevw /5UpBHl8CVcaDUufzWmd4A/RIwfpzIEZQ9X9wE8N9UjELYWCmwkFdhZEYD1v7NB60sjU U/zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language; bh=oI81EMvi2IboNe0MWS34dygN3MzS80C2az7x52yzXz0=; b=rnp7z2GOBLba8byvr9DgMOhGubVkoV6imW3dAmnARY4HIKD+VjHYp+l4pQjAO9IWJi 9WUU+nB4vjkwsJQkS3C8SC9YGch/En1LhhwUgHDGad/LOQCS9u2Se7ElF+sJwQTo8+sq LbYo2GiGrk1Ln/DdrJUHS9k1yl7KenCmk6ncL0zuuz5rhzV27jref8HmzFzkZAMruCdy MqpvUjrgAP3QtJTfRLrgj7NyPmWWPEhBwsDplMDX2uRm99+b4GrBVwbMCrcRLJVOMbZJ aB/R53vfOHl0seAAhGhRv2ZQhdNjulI/ejPYg5htDXdk5XhWalpJcELTnV3zU3ZrQqx8 mXAQ== X-Gm-Message-State: AOAM531uYsngC50jqzZXh5cLz6K6LKCWbtQM5QxeKwTVIsE5i4b/K77v SJLGQO7YV9TMp1JV9TB/g+sStRsN/H8= X-Google-Smtp-Source: ABdhPJzOyi79e3+20/jQs1jxWM4ruHJ2F5ZIW9cI2deBO806iB0/X4CaPW2SDQaqAdpwi+/bUPqQYA== X-Received: by 2002:a17:90b:4b4e:: with SMTP id mi14mr116962pjb.122.1638214281702; Mon, 29 Nov 2021 11:31:21 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id mp12sm119113pjb.39.2021.11.29.11.31.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Nov 2021 11:31:21 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: Gregory Heytings , Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> From: Jim Porter Message-ID: <0cbd22ae-e1e9-c6fb-a907-48bcc98dc6f2@gmail.com> Date: Mon, 29 Nov 2021 11:31:20 -0800 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------E7EEC49F63D237D7D1D22B4B" Content-Language: en-US X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------E7EEC49F63D237D7D1D22B4B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 11/29/2021 5:40 AM, Gregory Heytings wrote: > > I'm in the process of implementing something that should satisfy > everyone, but it's not finished yet. Thanks. Hopefully my proposal helps to explain more precisely my mental model and how I'd like things to work. If there's anything that's not clear, just let me know and I'll try to elaborate on it. In case it would help, I've also attached the relevant bits of my Emacs configuration, which implements the Explicit Shutdown behavior I've described. Overall, it's similar to the first patch I posted in this bug, but it's usable in Emacs 27+ (maybe even earlier). However, I think it has (at least) one problem: if `server-buffer-done' (indirectly called by `server-edit' / `C-x #') deletes the last client, it doesn't stop the daemon. I haven't had a chance to look into this in detail yet though. I think the most consistent behavior would be to stop the daemon in this case, since then the logic is simply "stop the daemon when the last client would be deleted", and we don't have to worry about exceptions to that rule. --------------E7EEC49F63D237D7D1D22B4B Content-Type: text/plain; charset=UTF-8; name="server-advice.el" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="server-advice.el" KHVzZS1wYWNrYWdlIHNlcnZlcgogIDpkZWZlciB0CiAgOnByZWZhY2UKICAoZGVmdW4gdXNl ci0tc2VydmVyLXNhdmUtYnVmZmVycy1raWxsLXRlcm1pbmFsIChhcmcpCiAgICAiT2ZmZXIg dG8gc2F2ZSBlYWNoIGJ1ZmZlciwgdGhlbiBraWxsIHRoZSBjdXJyZW50IGNsaWVudC4KV2l0 aCBBUkcgbm9uLW5pbCwgc2lsZW50bHkgc2F2ZSBhbGwgZmlsZS12aXNpdGluZyBidWZmZXJz LCB0aGVuIGtpbGwuCgpJZiBlbWFjc2NsaWVudCB3YXMgc3RhcnRlZCB3aXRoIGEgbGlzdCBv ZiBmaWxlbmFtZXMgdG8gZWRpdCwgdGhlbgpvbmx5IHRoZXNlIGZpbGVzIHdpbGwgYmUgYXNr ZWQgdG8gYmUgc2F2ZWQuCgpJZiBFbWFjcyB3YXMgc3RhcnRlZCBhcyBhIGRhZW1vbiBhbmQg dGhpcyB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2MpCiAgICAgICAgICAgICAoaWYgKHNlcS1zb21lCiAgICAgICAg ICAgICAgICAgIChsYW1iZGEgKGZyYW1lKQogICAgICAgICAgICAgICAgICAgIChsZXQgKChw IChmcmFtZS1wYXJhbWV0ZXIgZnJhbWUgJ2NsaWVudCkpKQogICAgICAgICAgICAgICAgICAg ICAgKHVubGVzcyAoYW5kIChkYWVtb25wKSAobnVsbCBwKSkKICAgICAgICAgICAgICAgICAg ICAgICAgKG5vdCAoZXF1YWwgcHJvYyBwKSkpKSkKICAgICAgICAgICAgICAgICAgKGZyYW1l LWxpc3QpKQogICAgICAgICAgICAgICAgIDs7IElmIHRoZXJlJ3MgYSBmcmFtZSBub3QgZnJv bSB0aGlzIGNsaWVudCwgb25seSBkZWxldGUgdGhlCiAgICAgICAgICAgICAgICAgOzsgY2xp ZW50LgoJICAgICAgICAgKGxldCAoKGJ1ZmZlcnMgKHByb2Nlc3MtZ2V0IHByb2MgJ2J1ZmZl cnMpKSkKCSAgICAgICAgICAgKHNhdmUtc29tZS1idWZmZXJzCgkgICAgICAgICAgICBhcmcg KGlmIGJ1ZmZlcnMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IE9ubHkgZmlsZXMg ZnJvbSBlbWFjc2NsaWVudCBmaWxlIGxpc3QuCgkJICAgICAgICAgICAgKGxhbWJkYSAoKSAo bWVtcSAoY3VycmVudC1idWZmZXIpIGJ1ZmZlcnMpKQogICAgICAgICAgICAgICAgICAgICAg ICAgIDs7IE5vIGVtYWNzY2xpZW50IGZpbGUgbGlzdDogZG9uJ3Qgb3ZlcnJpZGUKICAgICAg ICAgICAgICAgICAgICAgICAgICA7OyBgc2F2ZS1zb21lLWJ1ZmZlcnMtZGVmYXVsdC1wcmVk aWNhdGUnICh1bmxlc3MKICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBBUkcgaXMgbm9u LW5pbCksIHNpbmNlIHdlJ3JlIG5vdCBraWxsaW5nCiAgICAgICAgICAgICAgICAgICAgICAg ICAgOzsgRW1hY3MgKHVubGlrZSBgc2F2ZS1idWZmZXJzLWtpbGwtZW1hY3MnKS4KCQkgICAg ICAgICAgKGFuZCBhcmcgdCkpKQoJICAgICAgICAgICAoc2VydmVyLWRlbGV0ZS1jbGllbnQg cHJvYykpCiAgICAgICAgICAgICAgIDs7IElmIGFsbCBmcmFtZXMgYXJlIGZyb20gdGhpcyBj bGllbnQsIGtpbGwgRW1hY3MuCiAgICAgICAgICAgICAgIChzYXZlLWJ1ZmZlcnMta2lsbC1l bWFjcyBhcmcpKSkKCSAgICAodCAoZXJyb3IgIkludmFsaWQgY2xpZW50IGZyYW1lIikpKSkp CgogIChkZWZ1biB1c2VyLS1zZXJ2ZXIta2lsbC1lbWFjcy1xdWVyeS1mdW5jdGlvbiAoKQog ICAgIkFzayBiZWZvcmUgZXhpdGluZyBFbWFjcyBpZiBpdCBoYXMgbGl2ZSBjbGllbnRzLgpJ ZiBFbWFjcyB3YXMgc3RhcnRlZCBhcyBhIGRhZW1vbiBhbmQgdGhlIG9ubHkgbGl2ZSBjbGll bnQgaXMgdGhlCmN1cnJlbnQgZnJhbWUncyBjbGllbnQsIGRvbid0IGJvdGhlciBhc2tpbmcu IgogICAgKGxldCAoKGlnbm9yZWQtcHJvYyAoYW5kIChkYWVtb25wKSAoZnJhbWUtcGFyYW1l dGVyIG5pbCAnY2xpZW50KSkpKQogICAgICAob3IgKG5vdCAoc2VxLXNvbWUgKGxhbWJkYSAo cHJvYykKICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVubGVzcyAoZXEgaWdub3JlZC1w cm9jIHByb2MpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNlcS1zb21lICMnYnVm ZmVyLWxpdmUtcAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocHJv Y2Vzcy1nZXQgcHJvYyAnYnVmZmVycykpKSkKICAgICAgICAgICAgICAgICAgICAgICAgIHNl cnZlci1jbGllbnRzKSkKICAgICAgICAgICh5ZXMtb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ICAgICAgIyd1c2VyLS1zZXJ2ZXIta2lsbC1lbWFjcy1xdWVyeS1mdW5jdGlvbikKICAoYWRk LWhvb2sgJ2RlbGV0ZS1mcmFtZS1mdW5jdGlvbnMgIyd1c2VyLS1oYW5kbGUtZGVsZXRlLWZy YW1lKSkK --------------E7EEC49F63D237D7D1D22B4B-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 31 19:11:57 2021 Received: (at 51993) by debbugs.gnu.org; 1 Jan 2022 00:11:57 +0000 Received: from localhost ([127.0.0.1]:57590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3S04-00065B-Vs for submit@debbugs.gnu.org; Fri, 31 Dec 2021 19:11:57 -0500 Received: from mail-pj1-f41.google.com ([209.85.216.41]:52780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3S03-00064y-Bb for 51993@debbugs.gnu.org; Fri, 31 Dec 2021 19:11:55 -0500 Received: by mail-pj1-f41.google.com with SMTP id co15so24490180pjb.2 for <51993@debbugs.gnu.org>; Fri, 31 Dec 2021 16:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=j/toyoYcKsvnBqIuATUa8/WQM99p+Bz2+bF3TEuORdE=; b=bXtdnOYeCQ7a5TB1tVo+uHrbC3WsA+SceaynVyJOy0I+9GDTVrNIL65dYBkJje2z5r J7MBGuvzpSlJn2SXy8xjdYcWyHFvVf4Ltn9alFHaJUS4CtF2O6LmMYficJ1N7w2ZFh5l 5RkMpPwDdJ8x+r8+MY7sC+3hDZGc08vpwjSlJYdFqq1BdJnNFxb/y60zyKMxiqZFRt5O 7PmAPXLCKm0csmi/LfS8cSnkWLla8qdVPITAIyeVBdJdtd23Q5cEXmzCqxJbs7/Csqat vNBibyYQPmNjW72N+656l3TytYLwmX0x63DoWZa+BvioBY5ZZhyWtzJVQTrAXgzoxCzC wnFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=j/toyoYcKsvnBqIuATUa8/WQM99p+Bz2+bF3TEuORdE=; b=mob0c217QLC0JUudPhKjH+dwK0MdpHG3k0MziTMrbK8lmcTYnuF8j7CfYYJn9A1uKj W/l2SEtXavZX2cSREx5gYi9wMO7Y4WJtdyWtudJxFGnYv+1iE69n3BGZkQAsWldOliSF 2wWrO7e7Q7NWmOATFcu5CODmqWrG3+FVFVKGziGh5CYSBWUcbtKKs2o2mBOYuNsmar0I VVeAu1cFqdteVbGgX6FA4ooaFnotcj/fdnuFiQBlkWHNNaI54pAs10NIFE4bNgFOFngz 8aBXUclBwRMGJaC3lHzDeZ0meT/PZiSezhd1QUWrz7sZulv932fJ6fAU8BKydNg6qyJ6 351A== X-Gm-Message-State: AOAM530lw9rYnvaqDZyuQBcfd2rb5qD9+B2eAwg+DHz8MekJZoVRn9kr UXI14lhk2q08z39MlBMnu+FFERlaRY0= X-Google-Smtp-Source: ABdhPJwSxsHAKRVA/39eXOSHi5nZvMrKqGszHHPJHzdZPF+clnD9I/TmeAJcGF+8aCf0W8Z+psbDuw== X-Received: by 2002:a17:90a:ce04:: with SMTP id f4mr45554470pju.10.1640995909699; Fri, 31 Dec 2021 16:11:49 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id u10sm5989593pfg.59.2021.12.31.16.11.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 31 Dec 2021 16:11:49 -0800 (PST) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files From: Jim Porter To: Gregory Heytings , Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <0cbd22ae-e1e9-c6fb-a907-48bcc98dc6f2@gmail.com> Message-ID: <846fff6e-08c6-f0ba-2cfa-aa309d7c0d1d@gmail.com> Date: Fri, 31 Dec 2021 16:11:48 -0800 MIME-Version: 1.0 In-Reply-To: <0cbd22ae-e1e9-c6fb-a907-48bcc98dc6f2@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 11/29/2021 11:31 AM, Jim Porter wrote: > On 11/29/2021 5:40 AM, Gregory Heytings wrote: >> >> I'm in the process of implementing something that should satisfy >> everyone, but it's not finished yet. > > Thanks. Hopefully my proposal helps to explain more precisely my mental > model and how I'd like things to work. If there's anything that's not > clear, just let me know and I'll try to elaborate on it. Just checking to see if there have been any updates here. As before, I'm happy to assist wherever needed, be it writing patches or just providing feedback. Of course, no worries if you're busy with other things; I don't think there's any urgent need to merge a fix. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 09 13:56:07 2022 Received: (at 51993) by debbugs.gnu.org; 9 Sep 2022 17:56:07 +0000 Received: from localhost ([127.0.0.1]:35379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWiEZ-00081z-DG for submit@debbugs.gnu.org; Fri, 09 Sep 2022 13:56:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWiEX-00081S-Tm for 51993@debbugs.gnu.org; Fri, 09 Sep 2022 13:56:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=J6livP/KLmw5gn6XortcE5NnosX1hmRTjMARWde2jeg=; b=SzZaVZkm56xEsNRGL+prOrkm/L GFE99JWyp3UmmdlPo7x/NFP6Dj2KV8wRvO160KSr1qQQiu/xM/ln4JKv+QBFaIeUZyRgYXuSA+YLq CeeXvC+4VRo3RRU7LhTic9M5DqeFsUtLddE3bggtfYgb0kAbuEXuOG+846gw7juHUK94=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWiEO-0001CG-Qg; Fri, 09 Sep 2022 19:55:59 +0200 From: Lars Ingebrigtsen To: Gregory Heytings Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files In-Reply-To: (Gregory Heytings's message of "Mon, 29 Nov 2021 13:40:09 +0000") References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> X-Now-Playing: Supertramp's _Breakfast in America_: "Casual Conversations" Date: Fri, 09 Sep 2022 19:55:56 +0200 Message-ID: <87czc4tosz.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Gregory Heytings writes: >> However, I'm not sure I understand the way forward, as you see >> it. AFAIU, there are fundamental disagreements between you and >> Gregory, and I don't think the disagreements are there because on [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: Jim Porter , Eli Zaretskii , 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Gregory Heytings writes: >> However, I'm not sure I understand the way forward, as you see >> it. AFAIU, there are fundamental disagreements between you and >> Gregory, and I don't think the disagreements are there because one >> of you doesn't understand the proposals of the other. >> >> So how could these disagreements be reconciled? > I'm in the process of implementing something that should satisfy > everyone, but it's not finished yet. This was half a year ago, and I'm not sure whether anything further was done here? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 09 14:04:47 2022 Received: (at 51993) by debbugs.gnu.org; 9 Sep 2022 18:04:47 +0000 Received: from localhost ([127.0.0.1]:35401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWiMw-00022e-P2 for submit@debbugs.gnu.org; Fri, 09 Sep 2022 14:04:46 -0400 Received: from mail-pj1-f41.google.com ([209.85.216.41]:41520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWiMs-00022K-DK for 51993@debbugs.gnu.org; Fri, 09 Sep 2022 14:04:45 -0400 Received: by mail-pj1-f41.google.com with SMTP id q15-20020a17090a304f00b002002ac83485so2383920pjl.0 for <51993@debbugs.gnu.org>; Fri, 09 Sep 2022 11:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:from:to:cc:subject :date; bh=NglBviyyrPc8To6kukzaz3Mm2XZtUtAa1Y6/30+vnrA=; b=ouexjrg2N6CFNbqF90C0khS0BHYvcnlUHOgy5dHTaJQY323QL7IUrhKK0tZMkfcGMg DgepBp5TrbSfYlSp9egiUxtnGFOjTJTHWn724hK75APytPkSP6bdqcE7TsflhiUrrN/7 JAKoynVVI3ljfMQAHMBLXj07i6rFLKeMLrra7hh+WxI6/KneDBlsav0yeJxTsiUJO5sF D7K6lLu2xKbEGD+mfQzy5Wy105bg0f2KjBLq+DSys6yaHYutvP2Pwmcmn313+SToKWcs NDM/8jAIQwHjpyIzZYwLgE5Zeib0TyqAESJItQWX42PcdSqkhb+6obrahYEDMROaAs8i pq1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:from:references:cc:to:subject:x-gm-message-state :from:to:cc:subject:date; bh=NglBviyyrPc8To6kukzaz3Mm2XZtUtAa1Y6/30+vnrA=; b=NhGBpza8FoguneY+MK6nqtQDjQWVg/dJjL/MbWh/GruRYSu7eW/bt5XKltm0ujFN2C 6uYdkibBZpffMnMDbmAJiQgtXTTE5SbCZ0/KuTpvTFGkvne7y1UnVQr9zc8Eg6vl3rJS qNA8z8Iaj8uCM5JENKNIGzfz3YcYDZA4JuQT1EfPh0NjhldG0D4Nxp1u+JvbvuWWzmyf 5+UgRCoHOoTOQA3Yl9cqO0FU1m87sbw/6xZB1KdHhaVkAH8ui0Xj6I2jlbs1GoxZCzi4 NjyBRpX+GEfx8Z0r0fZYWx0IOxVny32RpDhdwcTkD+hNICeNzifUz5umazMco2oUa6TC Ds8g== X-Gm-Message-State: ACgBeo0Mwnt3hnBMJugs25tv6uhSdNBeQYAQ02O/ta+GFTe/ybX7rUga 1Q4Wt40tdQI9/kN4aICMNpTnXpgqstw= X-Google-Smtp-Source: AA6agR6y/7DYbyBipg6MCtse2HhMj1Okt1iIJWpUChYtHHs2eOPBey0NMR0q6C2Y9ExKR9oT0VkZ9A== X-Received: by 2002:a17:90a:1f49:b0:202:7a55:558f with SMTP id y9-20020a17090a1f4900b002027a55558fmr6971076pjy.108.1662746676518; Fri, 09 Sep 2022 11:04:36 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id s8-20020a17090a880800b0020036e008bcsm764593pjn.4.2022.09.09.11.04.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Sep 2022 11:04:35 -0700 (PDT) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files To: Lars Ingebrigtsen , Gregory Heytings References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> From: Jim Porter Message-ID: Date: Fri, 9 Sep 2022 11:04:36 -0700 MIME-Version: 1.0 In-Reply-To: <87czc4tosz.fsf@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: Eli Zaretskii , 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 9/9/2022 10:55 AM, Lars Ingebrigtsen wrote: > Gregory Heytings writes: > >>> However, I'm not sure I understand the way forward, as you see >>> it. AFAIU, there are fundamental disagreements between you and >>> Gregory, and I don't think the disagreements are there because one >>> of you doesn't understand the proposals of the other. >>> >>> So how could these disagreements be reconciled? > >> I'm in the process of implementing something that should satisfy >> everyone, but it's not finished yet. > > This was half a year ago, and I'm not sure whether anything further was > done here? For what it's worth, I've been brainstorming some ideas for how to abstract things out a bit further to make it easy for users to tune the behavior just to their liking. I haven't gotten very far on that yet, though. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 09 18:09:25 2022 Received: (at 51993) by debbugs.gnu.org; 9 Oct 2022 22:09:26 +0000 Received: from localhost ([127.0.0.1]:45064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oheU9-0007sJ-4S for submit@debbugs.gnu.org; Sun, 09 Oct 2022 18:09:25 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:43885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oheU7-0007s5-6t for 51993@debbugs.gnu.org; Sun, 09 Oct 2022 18:09:24 -0400 Received: by mail-pf1-f175.google.com with SMTP id 204so9295245pfx.10 for <51993@debbugs.gnu.org>; Sun, 09 Oct 2022 15:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:cc:to:from:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=asP3VqTQbZJTF7rhbGviKE/YJnfyZQQBOg5fc6qiAjE=; b=nO21Hraqiifj1SDX31VPIlW7uc2Crv2vhdvpQZm+7XU/37xzHVUCb8Jd/RWvDSYUKD hIYefzzkRe/xcOfcErAbuEJN3ODmkwkGroaEUW6SV7iBQMmMhDwMhPAZWbmgJmT1pBIt MNe5hSUziWWwlbUH/KxGXDQc/ioprsKfSDbOSRoRS9TuKAphR+sRIoNUhk0yDrv3CeK3 0339wqVQX5K+WajcGfTHS2/Npxb5KQ3cUYRNdD06NIp8ws7cuC9Q3yBQm61BCZYkyT3O rmkS7IOVGgAoZdO/DsaSHrIdycHtlVW6qfEeTtYYOynH+2467rzaSUyBTnYywLYpz8ln zA6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:cc:to:from:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=asP3VqTQbZJTF7rhbGviKE/YJnfyZQQBOg5fc6qiAjE=; b=TxEA2+zvApaZjiGAJ6QaWaBQkSHDNLqzz0bhzEimzbexYXkadgtFYihCluGNp2xVeQ /XTuBLl9VbkyTGyJbMQ/Nkkp+P+nzS6i4d4UPA43DVIFW1KVLCujQx4nI35tS6FtCC+J qBGxdTGbH1yPGvYQPcz8yZRuQ7WLMls10T4Xql89WKIrX9uplVg2MNdizIAFYaWVwNLE IkM0PvT//chIQE6UnXz7y2/tXFgjajCzcWqYBH4x/gvSw4SE9ACNt4qTV8sRKQdhP+kI qf2ZUhFyIkGtkrBUYKHxKRIinRS1VTE24co1lne5vmyFmMLPCILOM38wjM4MwM7LhTlm i47w== X-Gm-Message-State: ACrzQf27a20TRq0kwMdrye2bP1i6qEu+0MPwywdqIPl7a73bf1Orv/pY 0OuFmMX6xLzlrOIbBV+efEg= X-Google-Smtp-Source: AMsMyM4CBUOtrJV3dSttvQplMd7s/iZt42xAMoKiypftpxXwqTkeHI76/lhGwcL+gNeOiFE54TOIUg== X-Received: by 2002:a05:6a00:1828:b0:563:24ea:5728 with SMTP id y40-20020a056a00182800b0056324ea5728mr5996406pfa.3.1665353357011; Sun, 09 Oct 2022 15:09:17 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id p13-20020a170902780d00b0017d0e793932sm3755319pll.215.2022.10.09.15.09.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Oct 2022 15:09:16 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------4u9ZszFBFAMSwCxX75hetToq" Message-ID: Date: Sun, 9 Oct 2022 15:09:15 -0700 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US From: Jim Porter To: Lars Ingebrigtsen , Gregory Heytings References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> In-Reply-To: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: Eli Zaretskii , 51993@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------4u9ZszFBFAMSwCxX75hetToq Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/9/2022 11:04 AM, Jim Porter wrote: > On 9/9/2022 10:55 AM, Lars Ingebrigtsen wrote: >> Gregory Heytings writes: >> >>>> However, I'm not sure I understand the way forward, as you see >>>> it. AFAIU, there are fundamental disagreements between you and >>>> Gregory, and I don't think the disagreements are there because one >>>> of you doesn't understand the proposals of the other. >>>> >>>> So how could these disagreements be reconciled? >> >>> I'm in the process of implementing something that should satisfy >>> everyone, but it's not finished yet. >> >> This was half a year ago, and I'm not sure whether anything further was >> done here? > > For what it's worth, I've been brainstorming some ideas for how to > abstract things out a bit further to make it easy for users to tune the > behavior just to their liking. I haven't gotten very far on that yet, > though. Attached is a very WIP patch that hopefully gets across the idea I had. Hopefully the explanation below is sufficiently-clear; if anyone has questions, or if I missed some detail, let me know. (Note: the first patch is just a bugfix so that 'server-delete-client' doesn't get called when Emacs *creates* the client.) The patch adds two new hooks: 'server-before-delete-client-functions' and 'server-after-delete-client-functions'. These should give people the ability to add whatever behaviors they think make sense when closing an emacsclient connection. The default behavior is the same as the current default (call 'save-some-buffers' before deleting the client, and do nothing after). To do something like the 'delete-frame' configuration of the current 'server-stop-automatically' API, you might do something like this: (add-hook 'server-before-delete-client-functions (lambda (proc arg) (when (>= 1 (seq-count (lambda (frame) "Return non-nil if FRAME's client is another process." (not (equal (frame-parameter frame 'client) proc))) (frame-list))) ;; If there are no non-daemon frames other than ones owned by ;; this client, we want to do all the prompting that ;; 'save-buffers-kill-emacs' does, but without really killing. ;; HACK ALERT: This is a pretty clumsy way to do this... (cl-letf (((symbol-function 'kill-emacs) #'ignore)) (save-buffers-kill-emacs arg)) ;; Stop running other hooks. t))) (add-hook 'server-after-delete-client-functions (lambda (proc) ;; Kill emacs if the only frame left is the daemon frame. (unless (cdr (frame-list)) (kill-emacs)))) (Some helper functions might make these hooks simpler, of course.) This interface has some other potentially-interesting uses. For example, the after-deletion hook could start a timer and only kill Emacs if no new clients connected after N seconds[1]. That would be useful in cases like `git rebase -i` where Git might run your $EDITOR multiple times in a row. It would be a waste of CPU to shut down and restart the Emacs daemon every time. One thing I'm not sure about yet: should the 'empty' setting for 'server-stop-automatically' just become a hook on 'server-after-delete-client-functions'? It's not *quite* the same, since the 'empty' setting will also leave the daemon running until any active subprocesses finish too. Maybe it would make sense for 'server-stop-automatically' to stick around, but just be a boolean (when non-nil, use the current 'empty' behavior)? Then we keep all the nice features of the 'empty' setting, and the other behaviors can be implemented via these new hooks. [1] This might need an additional hook like 'server-after-create-client-functions'. --------------4u9ZszFBFAMSwCxX75hetToq Content-Type: text/plain; charset=UTF-8; name="0001-Only-delete-server-client-from-the-sentinel-when-the.patch" Content-Disposition: attachment; filename*0="0001-Only-delete-server-client-from-the-sentinel-when-the.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA2MjBkM2R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yNS4xCgo= --------------4u9ZszFBFAMSwCxX75hetToq Content-Type: text/plain; charset=UTF-8; name="0002-WIP-Add-hooks-before-after-deleting-Emacs-clients.patch" Content-Disposition: attachment; filename*0="0002-WIP-Add-hooks-before-after-deleting-Emacs-clients.patch" Content-Transfer-Encoding: base64 RnJvbSA3YjI1NjNhY2MwNjQ1ODZiNjc0ZjY4YWJkNGVlYmQxMWI1NjhlNzZiIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFN1biwgOSBPY3QgMjAyMiAxNDo1MDowNiAtMDcwMApTdWJqZWN0OiBbUEFU Q0ggMi8yXSBbV0lQXSBBZGQgaG9va3MgYmVmb3JlL2FmdGVyIGRlbGV0aW5nIEVtYWNzIGNs aWVudHMKCiogbGlzcC9zZXJ2ZXIuZWwgKHNlcnZlci1iZWZvcmUtZGVsZXRlLWNsaWVudC1m dW5jdGlvbnMpCihzZXJ2ZXItYWZ0ZXItZGVsZXRlLWNsaWVudC1mdW5jdGlvbnMpOiBOZXcg ZGVmY3VzdG9tcy4KKHNlcnZlci1kZWxldGUtY2xpZW50KTogTmV3IGFyZ3VtZW50IEFSRy4g IEhhbmRsZSAnbm93YWl0JyB2YWx1ZSBmb3IKUFJPQy4gIFJ1biB0aGUgYWJvdmUgaG9va3Mu CihzZXJ2ZXItc2F2ZS1idWZmZXJzLWtpbGwtdGVybWluYWwpOiBFeHRyYWN0IGJ1ZmZlci1z YXZpbmcgY29kZSBmcm9tCmhlcmUuLi4KKHNlcnZlci1zYXZlLXNvbWUtYnVmZmVycyk6IC4u LiB0byB0aGlzIG5ldyBmdW5jdGlvbi4KLS0tCiBsaXNwL3NlcnZlci5lbCB8IDc4ICsrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrKy0tLS0tLS0tLS0tLS0tLS0tCiAxIGZpbGUg Y2hhbmdlZCwgNTEgaW5zZXJ0aW9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yAgICAgICAgICAgICAgIDs7IE9ubHkgZmlsZXMgZnJvbSBl bWFjc2NsaWVudCBmaWxlIGxpc3QuCisJICAgICAgIChsYW1iZGEgKCkgKG1lbXEgKGN1cnJl bnQtYnVmZmVyKSBidWZmZXJzKSkKKyAgICAgICAgICAgICA7OyBObyBlbWFjc2NsaWVudCBm aWxlIGxpc3Q6IGRvbid0IG92ZXJyaWRlCisgICAgICAgICAgICAgOzsgYHNhdmUtc29tZS1i dWZmZXJzLWRlZmF1bHQtcHJlZGljYXRlJyAodW5sZXNzIEFSRyBpcworICAgICAgICAgICAg IDs7IG5vbi1uaWwpLCBzaW5jZSB3ZSdyZSBub3Qga2lsbGluZyBFbWFjcyAodW5saWtlCisg ICAgICAgICAgICAgOzsgYHNhdmUtYnVmZmVycy1raWxsLWVtYWNzJykuCisJICAgICAoYW5k IGFyZyB0KSkpKSkpCiAKIChkZWZ1biBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5LS1oYW5k bGUtZGVsZXRlLWZyYW1lIChmcmFtZSkKICAgIkhhbmRsZSBkZWxldGlvbiBvZiBGUkFNRSB3 aGVuIGBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5JyBpcyB1c2VkLiIKLS0gCjIuMjUuMQoK --------------4u9ZszFBFAMSwCxX75hetToq-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 10 02:04:47 2022 Received: (at 51993) by debbugs.gnu.org; 10 Oct 2022 06:04:47 +0000 Received: from localhost ([127.0.0.1]:45486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohluB-0002ts-FL for submit@debbugs.gnu.org; Mon, 10 Oct 2022 02:04:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohlu8-0002td-QI for 51993@debbugs.gnu.org; Mon, 10 Oct 2022 02:04:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohlu0-000483-MD; Mon, 10 Oct 2022 02:04:38 -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=VQfM6WQc+KSqD/X4JhjAlUVulJrGvEVD+GZVllozSFU=; b=ZyD5qB9lrEuh DGGgRb1ZJ7S9YGG0RBUJn/7dmDp85aWHcCRFTNeOfcdLj/3m1yRc78bp42TdGb4knAlfqpBnjFsXV 6tiuH0xTf/a9wdx6naOLIEdQLfQqCX93ceYx/DxpghPMoD+QiDtY0hheLif9FsTNtqXJbnxD3NiiH PVWtmpuu1/CHRISUMnWCnuUG9Pf0GaSqeAgPboSYKlI0JbVv2eZYKtw3hmBtj3Sf1WRTMgLkQRe/5 je4Lci1I3qN8/dUr70K7P7tDasVUIA5zsQVkImSZuAHm74ljCp+Rsli4JmKkmx8x8BXYKLVcYENaA PASIcUqxpnNT37yHq3bmpA==; Received: from [87.69.77.57] (port=1607 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 1ohlu0-0008Uq-0B; Mon, 10 Oct 2022 02:04:36 -0400 Date: Mon, 10 Oct 2022 09:04:38 +0300 Message-Id: <83lepoi58p.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: (message from Jim Porter on Sun, 9 Oct 2022 15:09:15 -0700) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 9 Oct 2022 15:09:15 -0700 > From: Jim Porter > Cc: Eli Zaretskii , 51993@debbugs.gnu.org > > The patch adds two new hooks: 'server-before-delete-client-functions' > and 'server-after-delete-client-functions'. These should give people the > ability to add whatever behaviors they think make sense when closing an > emacsclient connection. The default behavior is the same as the current > default (call 'save-some-buffers' before deleting the client, and do > nothing after). To do something like the 'delete-frame' configuration of > the current 'server-stop-automatically' API, you might do something like > this: Isn't this a bit of over-engineering for such a simple problem? Why couldn't we have a user option to decide what to do, and then just do it? The place where we delete client frames is well determined, so doing something sensible there should be easy. Hooks make sense when some Lisp program needs to turn on or off some aspects of Emacs behavior, not when a user needs to control that behavior. For users, controlling behavior with hooks should be reserved to relatively complex and/or obscure aspects of the behavior. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 23:14:51 2022 Received: (at 51993) by debbugs.gnu.org; 20 Oct 2022 03:14:51 +0000 Received: from localhost ([127.0.0.1]:60788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olM1C-00063S-SF for submit@debbugs.gnu.org; Wed, 19 Oct 2022 23:14:51 -0400 Received: from mail-pf1-f172.google.com ([209.85.210.172]:45869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olM18-000639-9D for 51993@debbugs.gnu.org; Wed, 19 Oct 2022 23:14:49 -0400 Received: by mail-pf1-f172.google.com with SMTP id 67so19035176pfz.12 for <51993@debbugs.gnu.org>; Wed, 19 Oct 2022 20:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=16GBFE3FVVXiaAJmIVmkV67kCmBD6Hq6pPkvuXsBozU=; b=BVeWDAI4I9dmlWZrVmLjdHLfenv43kGhB2vnB8Ojc0NWnL8+cr9ufjL1rWZ6Htl252 04Y7YU2O/sHAQTeUUH4HX5vI8/2PcRqrWW1F5o2jEZZtgkd8FZCPW7fGcqnpGlxPvuVN Lp8fQpLHOVo5lO8x47xzvkH3YGRrG8wy0NPqSuqBF4roN81rq9w3i5znh2W9zHPXWasS x6RNm0qUXnpVwDAr0PFUQVSxZbrfb0x8BoQ3AtVNdrVef13I9KZN8doOApguME2cuQk5 XFueomXGHfDIvwXSGHHWrzBl4A0Lf0zCKoqAZhPe0m72gmwXWRk9IdByV67G/BbKUXPU xGBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=16GBFE3FVVXiaAJmIVmkV67kCmBD6Hq6pPkvuXsBozU=; b=dnIDFqiER/zGLq3XGBLZwuiTv9iyWE9CDgphdHa0Pk7nocGalLk1nM8mNi4lUL9AUj bptU7tS9baZLcSC/FaLhmiSouqt9cDEfIFJ69W6NgpmWZYsQLCx06jLlcPMCf0jD9FUO vpC6lf94PWWTHV6EqR0WuQbvdIhkz/BDTlBCfqrj5cUYKhn/YvR1VUfWQrNtEX6LGmal p+XDhkt3I2vlBrfur2pCwgPR7dfkgMmfZs7ILSrgXN232ok4sNbajl4PIzwliTOD7m8I dyDl4KSjvF8jzbhAL+hua9ihtwQGXNXBbPcx20vmMdLzt90910li5qdNGVJiTht2C41J JzBQ== X-Gm-Message-State: ACrzQf0sh8O9OyOqoQsYkgKty+dCwuCNHN8B+Xbn23BxJMsYAAUv/jBJ WKsUJx7l6cQZZOeN8UqXPzo= X-Google-Smtp-Source: AMsMyM7PSv0cwU5j2ZApQlIFIfzGujy33OVw/+s5Oq0q/NJpAVNcqJnZgqISqDaSHxcvaUlfQRVdxg== X-Received: by 2002:a65:674e:0:b0:43c:3b91:236e with SMTP id c14-20020a65674e000000b0043c3b91236emr10028687pgu.510.1666235680250; Wed, 19 Oct 2022 20:14:40 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id om13-20020a17090b3a8d00b00200b12f2bf5sm3469414pjb.1.2022.10.19.20.14.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Oct 2022 20:14:39 -0700 (PDT) Message-ID: Date: Wed, 19 Oct 2022 20:14:38 -0700 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> From: Jim Porter In-Reply-To: <83lepoi58p.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10/9/2022 11:04 PM, Eli Zaretskii wrote: >> Date: Sun, 9 Oct 2022 15:09:15 -0700 >> From: Jim Porter >> Cc: Eli Zaretskii , 51993@debbugs.gnu.org >> >> The patch adds two new hooks: 'server-before-delete-client-functions' >> and 'server-after-delete-client-functions'. These should give people the >> ability to add whatever behaviors they think make sense when closing an >> emacsclient connection. The default behavior is the same as the current >> default (call 'save-some-buffers' before deleting the client, and do >> nothing after). To do something like the 'delete-frame' configuration of >> the current 'server-stop-automatically' API, you might do something like >> this: > > Isn't this a bit of over-engineering for such a simple problem? Why > couldn't we have a user option to decide what to do, and then just do > it? The place where we delete client frames is well determined, so > doing something sensible there should be easy. I'd be happy with a simple user option, provided we can all agree how things should work (or if we can't *all* agree, that you and Lars can decide at least). I thought adding a hook might get around the problem of not being able to agree, though. I proposed a couple of behaviors that I described in as much detail as I could in the hopes of avoiding confusion and coming to an agreement here: . To summarize it briefly, the behavior I would personally prefer is this. When deleting an emacs client by any means (e.g. 'C-x C-c', clicking the X on the last frame of a client, etc): a) if this is not the last client, behave the same as Emacs 28: prompt to save files specified when starting "emacsclient", and then delete that client. b) if this *is* the last client, prompt the user to save everything (as with 'save-buffers-kill-emacs'), and then delete the client + kill the Emacs daemon. I'm certainly open to supporting other options if people have different preferences, and I can work on a patch to support these so long as we come to an agreement/decision/compromise about the expected behavior(s). From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 20 02:23:47 2022 Received: (at 51993) by debbugs.gnu.org; 20 Oct 2022 06:23:47 +0000 Received: from localhost ([127.0.0.1]:60969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olOy3-0002Z4-Ba for submit@debbugs.gnu.org; Thu, 20 Oct 2022 02:23:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olOy0-0002Yn-9e for 51993@debbugs.gnu.org; Thu, 20 Oct 2022 02:23:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olOxu-0002Hf-VG; Thu, 20 Oct 2022 02:23:38 -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=/KaIFjpiBDBStMiGqGJPdj9KLte/OYs4yu7H3o4qjGM=; b=R/xMZejFkXRb XnOz1LjoUVECK11hrvC5uthdhey22dbkmnxH8nExXTxYWKpvMJ4sovwBSjXfFMKcDneNNPAne5T+g Z2KaessqSrmCnQM73Tq/Zq3jPNf0IPWznsCbtJCTnoEX+tyWrrhx9NehzhCuKJFeI1IP96BA1chFd IFynqZtTbWBnGmukxEvBYA0orvFeVq0N2sZ/kDtt9wX3qqnO7yUCFuzl6z1LtszDaET2GdJPAstP8 nX9JMF+dxxuOxq7OLecGmm5dVN930kKiXLedMTkeeMylej0UofO+syTkREIgPNjh7nAk/KbqmnkPH 09AqMbDEvFHtq6hkgz7RIQ==; Received: from [87.69.77.57] (port=1243 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 1olOxu-0000IR-ES; Thu, 20 Oct 2022 02:23:38 -0400 Date: Thu, 20 Oct 2022 09:23:34 +0300 Message-Id: <83y1tbxbbt.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: (message from Jim Porter on Wed, 19 Oct 2022 20:14:38 -0700) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 19 Oct 2022 20:14:38 -0700 > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > From: Jim Porter > > I proposed a couple of behaviors that I described in as much detail as I > could in the hopes of avoiding confusion and coming to an agreement > here: > . > > To summarize it briefly, the behavior I would personally prefer is this. > When deleting an emacs client by any means (e.g. 'C-x C-c', clicking the > X on the last frame of a client, etc): > > a) if this is not the last client, behave the same as Emacs 28: > prompt to save files specified when starting "emacsclient", and then > delete that client. > > b) if this *is* the last client, prompt the user to save everything > (as with 'save-buffers-kill-emacs'), and then delete the client + kill > the Emacs daemon. You mean, in b), instead of just deleting the frame and leaving the daemon run, you want to shut down Emacs in its entirety, as if the user invoked kill-emacs? I'm okay with that as an optional behavior, although I myself won't use it, as it's too dangerous. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 21 01:51:53 2022 Received: (at 51993) by debbugs.gnu.org; 21 Oct 2022 05:51:53 +0000 Received: from localhost ([127.0.0.1]:36661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olkwi-00032c-PK for submit@debbugs.gnu.org; Fri, 21 Oct 2022 01:51:53 -0400 Received: from mail-pl1-f182.google.com ([209.85.214.182]:37713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olkwg-00032O-Aa for 51993@debbugs.gnu.org; Fri, 21 Oct 2022 01:51:51 -0400 Received: by mail-pl1-f182.google.com with SMTP id d24so1421538pls.4 for <51993@debbugs.gnu.org>; Thu, 20 Oct 2022 22:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=RzLRczBcCsydB8MIdljJXIs4fiTg2CJcwEP/AzLTkPk=; b=glx6VA8SvucWE8UIiw27muzSmTL8b+3UpZlXKjVDGgGtjpLSUTsSiRS2qBj3xpYJVA bcx+qXvS5GJhaWafoupN3OkAsmZDjg94Cj25TzIg8VSiuSzBAD3hohbuO4FstRm2MvJq QdGeYpS/ZFAFJP9ilQcHQquiy4kxmIryRVn6giDTW9qt8qetdto02kXY9SFA1FYzBvtx WEtHr6OqQDbjkBFGFg0cr9AGM5A9wkSKiYH4v8OnWHjyL7pTnMCXfkgh+TjMSlPEFbNM zMYrX21flQAAHbfxT3z53tmE2dXMopsGolLMMA5+5+/A5jzYC2Cc2/i3vBH6asjLbkMt 61OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RzLRczBcCsydB8MIdljJXIs4fiTg2CJcwEP/AzLTkPk=; b=TycI+j12MHTddYrI5dXY8j3dHDnsQk3IbsLxnc1jSJ9PHU5oyjnaPAR+WxjOfH9sj1 fKULF2RCMyMaPxYg3vPqZWnl/87go39Rc0V79YEyLOebFjRaqTWsNUkY+Lq8IEmoB8Fi phr9Gblm14KaUAySGrz0xiOtzWsUzH0vqJ+kItmhv825o1LLWvcGLdneCHZ7rnFjbX2F A3UwSq0rMTPWWk+LE59wG7tDX8QZcHXhFIn6rupPPXcjzlbU3JR0evTga0as8XBT4xA7 tc7lUfnqd8pTMt05hafxJ3/QtZQO37gNqbEpU/+y9naFJ72dIif5YFhXeYECKPf6xcFR v3lQ== X-Gm-Message-State: ACrzQf3olni/EcQ2s4Kq4isr+sp29qZQvtlyKwzQfwLmv0plwOcdXR0d 8e1J0l20BfATF8H/dedgldi25O/rXX0= X-Google-Smtp-Source: AMsMyM69fs2JfcFssqQYs3mM4ZmskEJtZFQQBo9B7fCUmQfjK2smaHysslbrcMz/lUznub9JnhaL9w== X-Received: by 2002:a17:902:a60d:b0:186:61f6:d7f4 with SMTP id u13-20020a170902a60d00b0018661f6d7f4mr7124126plq.75.1666331504261; Thu, 20 Oct 2022 22:51:44 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id on7-20020a17090b1d0700b002005fcd2cb4sm917630pjb.2.2022.10.20.22.51.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Oct 2022 22:51:43 -0700 (PDT) Message-ID: Date: Thu, 20 Oct 2022 22:51:42 -0700 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> From: Jim Porter In-Reply-To: <83y1tbxbbt.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10/19/2022 11:23 PM, Eli Zaretskii wrote: >> Date: Wed, 19 Oct 2022 20:14:38 -0700 >> Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org >> From: Jim Porter >> >> a) if this is not the last client, behave the same as Emacs 28: >> prompt to save files specified when starting "emacsclient", and then >> delete that client. >> >> b) if this *is* the last client, prompt the user to save everything >> (as with 'save-buffers-kill-emacs'), and then delete the client + kill >> the Emacs daemon. > > You mean, in b), instead of just deleting the frame and leaving the > daemon run, you want to shut down Emacs in its entirety, as if the > user invoked kill-emacs? I'm okay with that as an optional behavior, > although I myself won't use it, as it's too dangerous. Almost. I'd like it to be as if the user invoked 'save-buffers-kill-emacs'; that is, before killing Emacs, prompt the user about everything[1] that might be lost by killing Emacs. This already exists as an option -- (server-stop-automatically 'delete-frame)[2], but I also find the current behavior too dangerous. My original message outlines one of the problems with the current implementation: it changes the behavior of (a) in my description above. > $ emacs -Q --daemon > $ emacsclient -a "" -c foo.txt > $ emacsclient -a "" -c bar.txt > > ;; In the first client frame: > foobar ;; Insert some text > C-x C-c > ;; Emacs prompts "Save file /path/to/foo.txt?..." > > Now try the above, but call `(server-stop-automatically 'delete-frame)' first (or replace `delete-frame' with `kill-terminal'; it doesn't matter). In this case, Emacs doesn't prompt to save the file. As mentioned earlier in this bug, I'm open to providing a patch to support options beyond the one I suggested (quoted at the beginning of this message), but I want to be sure we agree on what the options should look like so that I'm not breaking Gregory's (or anyone else's) preferred behavior here. (Of course, all of this would remain opt-in. I don't want to change the default behavior here, since it would break years of established precedent.) [1] Well, everything that Emacs usually asks about in a non-daemon configuration, anyway. [2] It's not hooked up to Customize, though I don't think that would be too hard to do. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 21 02:38:31 2022 Received: (at 51993) by debbugs.gnu.org; 21 Oct 2022 06:38:31 +0000 Received: from localhost ([127.0.0.1]:36716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ollfq-0004K3-UZ for submit@debbugs.gnu.org; Fri, 21 Oct 2022 02:38:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ollfn-0004Jp-EU for 51993@debbugs.gnu.org; Fri, 21 Oct 2022 02:38:28 -0400 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 1ollfi-0001Aj-0P; Fri, 21 Oct 2022 02:38:22 -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=yPQbv0TJMRc5R1dzQcvHSCZQGMYgd0oAYYZEGzcpszM=; b=Zw4sSdOm4ZvO gAzYv6iAcGZaUizKXKM8twyBVSzJAmy+mWbnhbvWmQ7e2PG/GNDBTlUCp+bjtoRSDDOwVSk6Vp+YG 4fd3wx9jSdqNd8OCq7voPf4IdzeQ2gE1fPB9/dMusnBFHhMeIK/mSWcq3g+xNjwrCxq2jvwuCCKsB 7mZhUdFMVzdcYZlUQ67Uk4WNJ29RWPYOuGvQOnlikVhiQ21NkilJaXEdwNqYdj5/zdFkDfAdhIB8A 9UU7TOEx1f4vJQqUUDlslRUaEutOTNNqcSTG4KYgwgMgl1iNimWSUNX/fcv9JNNa/ND8VQx7UsJcq rlfOblSOVLB6DXFl+YcnhQ==; 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 1ollfh-0007CL-FN; Fri, 21 Oct 2022 02:38:21 -0400 Date: Fri, 21 Oct 2022 09:38:19 +0300 Message-Id: <83h6zxwujo.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: (message from Jim Porter on Thu, 20 Oct 2022 22:51:42 -0700) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 20 Oct 2022 22:51:42 -0700 > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > From: Jim Porter > > >> b) if this *is* the last client, prompt the user to save everything > >> (as with 'save-buffers-kill-emacs'), and then delete the client + kill > >> the Emacs daemon. > > > > You mean, in b), instead of just deleting the frame and leaving the > > daemon run, you want to shut down Emacs in its entirety, as if the > > user invoked kill-emacs? I'm okay with that as an optional behavior, > > although I myself won't use it, as it's too dangerous. > > Almost. I'd like it to be as if the user invoked > 'save-buffers-kill-emacs'; that is, before killing Emacs, prompt the > user about everything[1] that might be lost by killing Emacs. That should already happen, if you just call save-buffers-kill-emacs in that case, right? > This already exists as an option -- (server-stop-automatically > 'delete-frame)[2], but I also find the current behavior too dangerous. > My original message outlines one of the problems with the current > implementation: it changes the behavior of (a) in my description above. > > > $ emacs -Q --daemon > > $ emacsclient -a "" -c foo.txt > > $ emacsclient -a "" -c bar.txt > > > > ;; In the first client frame: > > foobar ;; Insert some text > > C-x C-c > > ;; Emacs prompts "Save file /path/to/foo.txt?..." > > > > Now try the above, but call `(server-stop-automatically 'delete-frame)' first (or replace `delete-frame' with `kill-terminal'; it doesn't matter). In this case, Emacs doesn't prompt to save the file. I'm not sure I see the direct relevance, and I don't think I see a bug in the above behavior. I'm probably missing something, but what? From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 21 23:46:56 2022 Received: (at 51993) by debbugs.gnu.org; 22 Oct 2022 03:46:57 +0000 Received: from localhost ([127.0.0.1]:39461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1om5TM-00025t-Ge for submit@debbugs.gnu.org; Fri, 21 Oct 2022 23:46:56 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:46000) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1om5TL-00025g-47 for 51993@debbugs.gnu.org; Fri, 21 Oct 2022 23:46:55 -0400 Received: by mail-pl1-f179.google.com with SMTP id u6so3984634plq.12 for <51993@debbugs.gnu.org>; Fri, 21 Oct 2022 20:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=gJNAisIB/jayPvQPhwAmq7cvhohCseRa3oJHe7WYw9M=; b=Tm7txLzwi49NYKEnwpXy23IeOrcqOmx9LU8fRmJmnU3QZ1SMWHjF0/EozP3isSmUzY zDAZvQLNt5Psx8JCBI/Uw84GNHeIriBPzDzY6VLZ5SQr3qbS6S2o55hih7bcdzmN8Ln9 HZlVEHnZzW9O4aA6aorNmPT6XSDAIMMc6grdqaQQapqsBlXCp65Ap8D7800aja2GXEww 3Z9ZwflIJyHIAOzNwSs8pS9T2TjL9kna9Bd3huoulRh0XmA9KAxdV2Ap/5EIgV+iV0u5 yqIb2vgsFe9wfLra9CdKczHTYXkA/DcuLKmTlxae667DyQVaMCCqD77UYeYPmlsqkW/O pLlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gJNAisIB/jayPvQPhwAmq7cvhohCseRa3oJHe7WYw9M=; b=6DozG1P4I0VD0lnVcdrhXjh1SMYcDg2EQWvnrRejZVX5vUqiOZyybGdAzoSWRnPs1c K1UyheG2Eonxz98cs9lIQxuhw+BeRVRmHqyd7Ar/5eNq2mK5HC66Q2gtJT5WqKKKiVN1 iV05gQ5LPUohct5cGUwRsuXLUKBcl8kX3Du3iwQXOliAPRubyq7cBL5xbWLCeJ1yPCRn Q4xfwCDbUwdlcPus4BqKpqOtmQ5vQ8kzFl0MLlw7H1ADJPiTB4Neu+jtPFW6wqDgEBgY YJnT+JfQATJBnmB83xJ3oYCCLh5/kCQAcZ/3aK5+Jc8fl5OXLf/JBYwCXJI3jMj0yhQR raJg== X-Gm-Message-State: ACrzQf2ZF9SBVasG6uT/s2l74ODd8aogNxW6sZFJtHAJJkDICatd3GJh 0R546eTpasjVjAr6yZLTtgc= X-Google-Smtp-Source: AMsMyM7ZhxEJH5bW+j9WBMIKl9tcXtJ+TF7FxkR8DQt/2OQFwJo/YzYkUUX6/X7p7L4RX2eIR8ZQMQ== X-Received: by 2002:a17:90b:4a4d:b0:20d:4dc7:fa72 with SMTP id lb13-20020a17090b4a4d00b0020d4dc7fa72mr25152448pjb.86.1666410409072; Fri, 21 Oct 2022 20:46:49 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id m17-20020a656a11000000b0045751ef6423sm13969547pgu.87.2022.10.21.20.46.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Oct 2022 20:46:47 -0700 (PDT) Message-ID: <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> Date: Fri, 21 Oct 2022 20:46:47 -0700 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> From: Jim Porter In-Reply-To: <83h6zxwujo.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10/20/2022 11:38 PM, Eli Zaretskii wrote: >> Date: Thu, 20 Oct 2022 22:51:42 -0700 >> Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org >> From: Jim Porter >> >>>> b) if this *is* the last client, prompt the user to save everything >>>> (as with 'save-buffers-kill-emacs'), and then delete the client + kill >>>> the Emacs daemon. >>> >>> You mean, in b), instead of just deleting the frame and leaving the >>> daemon run, you want to shut down Emacs in its entirety, as if the >>> user invoked kill-emacs? I'm okay with that as an optional behavior, >>> although I myself won't use it, as it's too dangerous. >> >> Almost. I'd like it to be as if the user invoked >> 'save-buffers-kill-emacs'; that is, before killing Emacs, prompt the >> user about everything[1] that might be lost by killing Emacs. > > That should already happen, if you just call save-buffers-kill-emacs > in that case, right? Yeah. My expectation is that I can type 'C-x C-c' (or 'M-x save-buffers-kill-terminal') to kill a client, and if it's the last client, instead kill Emacs entirely (like 'M-x save-buffers-kill-emacs'). So roughly speaking, the change would be that you can set 'save-buffer-kill-terminal' to work like 'save-buffer-kill-emacs' when there's only 1 client left. >> This already exists as an option -- (server-stop-automatically >> 'delete-frame)[2], but I also find the current behavior too dangerous. >> My original message outlines one of the problems with the current >> implementation: it changes the behavior of (a) in my description above. >> >>> $ emacs -Q --daemon >>> $ emacsclient -a "" -c foo.txt >>> $ emacsclient -a "" -c bar.txt >>> >>> ;; In the first client frame: >>> foobar ;; Insert some text >>> C-x C-c >>> ;; Emacs prompts "Save file /path/to/foo.txt?..." >>> >>> Now try the above, but call `(server-stop-automatically 'delete-frame)' first (or replace `delete-frame' with `kill-terminal'; it doesn't matter). In this case, Emacs doesn't prompt to save the file. > > I'm not sure I see the direct relevance, and I don't think I see a bug > in the above behavior. I'm probably missing something, but what? The issue in the quote above is that if you enable automatic server shutdown in Emacs 29, it changes the behavior of exiting an emacsclient even when it wouldn't stop the server (i.e. when there are other active clients). That's surprising to me, I wouldn't expect that setting to affect cases when it decides *not* to kill the Emacs daemon. (This is relevant to the previous discussion since fixing this would get Emacs's automatic server shutdown - aka killing the daemon - close to the way I described there. Gregory mentioned[1] that the current behavior is intended, although we've had some difficulty coming to an agreement on how all this should work. Hence why I thought a hook might help here: if there are strong opinions in various directions, maybe a simple option isn't enough. Or maybe this is a case where you and/or Lars would be in a better position to make a final decision...) [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51993 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 02:57:13 2022 Received: (at 51993) by debbugs.gnu.org; 22 Oct 2022 06:57:13 +0000 Received: from localhost ([127.0.0.1]:39603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1om8RU-0000ru-Qw for submit@debbugs.gnu.org; Sat, 22 Oct 2022 02:57:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1om8RS-0000rg-OJ for 51993@debbugs.gnu.org; Sat, 22 Oct 2022 02:57:11 -0400 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 1om8RN-0002lP-B1; Sat, 22 Oct 2022 02:57:05 -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=lrxSsaURMzpDZdJ7qta7Bo7ATm5JLBWTpZVKffGzkpQ=; b=XN7OewEJOfpd YJ69z0fCcM3eonKhgK+Uszzn5dds1OAF9m1eyp8yCOQpUNlje1vi6qSc7m68vFPuidL/SaoCDu9Ee u0yjzaIfsyPy57OGUrzLFL6YLkR3ACyp1YrEIJzPa4fP3rQdOHPvwSXAk1gtEilPflpvE/cqq7JYr cDfYcT7pJM/+4WP7fZqz9yZlq0bFW0n8H9ioHEHNyT4+SDEeP1WrO3cKE0g7Dp7elIRe1C5wFuRsH Zhigms4fqI8UmFIdN6HQKOr0nQqqtoWihgvA4WLLKMV0hsmZsqq+iHfYg0JIpgc81z0cleo5pOBdI 6VySN7SzI0/Z8yRLzp+NkQ==; 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 1om8RM-00005F-PO; Sat, 22 Oct 2022 02:57:05 -0400 Date: Sat, 22 Oct 2022 09:57:05 +0300 Message-Id: <83a65ouz0e.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> (message from Jim Porter on Fri, 21 Oct 2022 20:46:47 -0700) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 21 Oct 2022 20:46:47 -0700 > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > From: Jim Porter > > >>> $ emacs -Q --daemon > >>> $ emacsclient -a "" -c foo.txt > >>> $ emacsclient -a "" -c bar.txt > >>> > >>> ;; In the first client frame: > >>> foobar ;; Insert some text > >>> C-x C-c > >>> ;; Emacs prompts "Save file /path/to/foo.txt?..." > >>> > >>> Now try the above, but call `(server-stop-automatically 'delete-frame)' first (or replace `delete-frame' with `kill-terminal'; it doesn't matter). In this case, Emacs doesn't prompt to save the file. > > > > I'm not sure I see the direct relevance, and I don't think I see a bug > > in the above behavior. I'm probably missing something, but what? > > The issue in the quote above is that if you enable automatic server > shutdown in Emacs 29, it changes the behavior of exiting an emacsclient > even when it wouldn't stop the server (i.e. when there are other active > clients). That's surprising to me, I wouldn't expect that setting to > affect cases when it decides *not* to kill the Emacs daemon. Sounds like a bug to me, because it contradicts what the doc string says. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 24 23:10:59 2022 Received: (at 51993) by debbugs.gnu.org; 25 Oct 2022 03:10:59 +0000 Received: from localhost ([127.0.0.1]:49934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onALD-0007c1-49 for submit@debbugs.gnu.org; Mon, 24 Oct 2022 23:10:59 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:47080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onALA-0007bm-0W for 51993@debbugs.gnu.org; Mon, 24 Oct 2022 23:10:57 -0400 Received: by mail-pl1-f172.google.com with SMTP id jo13so6507887plb.13 for <51993@debbugs.gnu.org>; Mon, 24 Oct 2022 20:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=qFprMwmRm1GYwNa9eC1hSDKv8o3F/6hwXhMMJbstccU=; b=lDMQLo0pGqUT9j6/PysdfJWh/4uzy6e4aADBKhqXzyEOZ/hvRsk4ANcZoXFbWaMoqj EYSnI088lMqY088T+2NpW31YeJTbl5dMJhH/EULplVu84yh6RB7ZthEzSJRtXN7+KHzJ AgoOBKSAWeOf5J22//fH2pFV0PD72S800dhKhmTRjh17LlASACs6JowUSbgSgwpVM1jc 3JKwd4kpkJoU7s13XcfKPVxpZTPkDHdQLs7U9dSkCOQMLY1TEPGaIbRYBsSt3Bb5sEf3 ejlD0n3sg/LIaK+qnJw8gnESrUR8moozYyrrRr62ukXxpRWBv05j0Tri0vIVk2D92Up8 KeOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qFprMwmRm1GYwNa9eC1hSDKv8o3F/6hwXhMMJbstccU=; b=Lj8lI6jyMuz/XjuhBBGyNCE3eWU4HddrLv4Qzl4+TSc/x8qa90Q7Akm/m2JopC9ifv hdGyg+aZZMzDcIgko4Kl24846jipNYTM6E4xlrH7hzM66jpZYTGYKC+jSEd90OF/nlqe zjTG5/AYxNTgE8aMBptCJ06ZVmMKkHoeW8YmYoTDCjm9+CXBGKEHkkUZ6LieFtrpF6pa eVGH9cD4jA0NRUFCFgSWboEoHQ5Y9SnOaRxI8ck9BMjZj6olbMuTP7nBbWPyjcNBw2g4 iAvvXunb+yN9cMb095jgw7lV8BR9f3wuDm9ot+bVRh4c4I2ko/I22qykauULIm59idrd FACg== X-Gm-Message-State: ACrzQf0lc0AZFHoDNoStWaM8SDzzQ70cpa1devKtTE3xWUn5pSJoJZTd 9AI5K4vGbjzSTYkmILwLgwY= X-Google-Smtp-Source: AMsMyM6OkVzs+m5EnRGSBZANtLFWWnsCOmmojpQSaWUps3xIGGx537mecg4MBEMHtRjfK0iLmoeY7Q== X-Received: by 2002:a17:902:d4c4:b0:186:a951:b8f9 with SMTP id o4-20020a170902d4c400b00186a951b8f9mr8236411plg.130.1666667449868; Mon, 24 Oct 2022 20:10:49 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id w8-20020a63f508000000b00462612c2699sm407715pgh.86.2022.10.24.20.10.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 20:10:48 -0700 (PDT) Message-ID: Date: Mon, 24 Oct 2022 20:10:46 -0700 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> From: Jim Porter In-Reply-To: <83a65ouz0e.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10/21/2022 11:57 PM, Eli Zaretskii wrote: >> Date: Fri, 21 Oct 2022 20:46:47 -0700 >> Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org >> From: Jim Porter >> >> The issue in the quote above is that if you enable automatic server >> shutdown in Emacs 29, it changes the behavior of exiting an emacsclient >> even when it wouldn't stop the server (i.e. when there are other active >> clients). That's surprising to me, I wouldn't expect that setting to >> affect cases when it decides *not* to kill the Emacs daemon. > > Sounds like a bug to me, because it contradicts what the doc string > says. That's how it seems to me too. In that case, I can update the patch I attached in my original message[1] to fix the bug. If we want to preserve the current behavior that Emacs 29 has exactly, we could also add a separate setting for how to handle killing the non-last client; then the two would be independently customizable. I'm not sure this is necessary, but if others think it is, I'm happy to write a patch for it. [1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-11/msg01702.html From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 30 18:33:04 2022 Received: (at 51993) by debbugs.gnu.org; 30 Oct 2022 22:33:04 +0000 Received: from localhost ([127.0.0.1]:39167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opGrX-0001wI-Pm for submit@debbugs.gnu.org; Sun, 30 Oct 2022 18:33:04 -0400 Received: from mail-pf1-f182.google.com ([209.85.210.182]:46632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opGrV-0001vn-Nz for 51993@debbugs.gnu.org; Sun, 30 Oct 2022 18:33:02 -0400 Received: by mail-pf1-f182.google.com with SMTP id b29so9174168pfp.13 for <51993@debbugs.gnu.org>; Sun, 30 Oct 2022 15:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:mime-version:date:message-id:from:to:cc:subject :date:message-id:reply-to; bh=quBL12EVm1P5Ff9qwN899y1u3up8eAeWYRJuVjyV9DY=; b=T+XkWX4iKM4A/tvRyKFLpiFrs7Cif26LLenDcMdEoboqiP7VVeNhp70OtaeOTcFkaP jGXhn2Wb8T8d9eVob1Glb2qTGtXgCi/ERA/gnV5WdTcd+Rq5U2ywPKISVtCqMLBm2HQe gqIcLJ05mVuwGjHh9ACLWfqhERf0NP7NTGU5ImtN7DGwczdZIxdOSQHVtuQzJRqVDq3M AoBCTqNl5ZT3ePYC89x+d6K3xN/jhw/wqOxbLV6Ku7azPOHQsZTlDMBC0AFaSoBDuUeI LlJ2tZPQAiNBB9af6voYJVB08u3XvXalGCuQ0IXVz8t67T5Lw9bPs3wj9pwvZKPEPmUs YhOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:mime-version:date:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=quBL12EVm1P5Ff9qwN899y1u3up8eAeWYRJuVjyV9DY=; b=Reb/mAIZD8RxEeDAhHBwA1AtRtaQe6sv9QRleK/QfVja+x8XlwQavqLBvGS5L6Ab0L uW3ujIniM6GMC11TSdAJHMi1YysDMhRA4GfxsjyDtpsb8bJqaknmupZT8IrCxcsxwMn8 +A/sXMwFe/m9Pyokwr5W8dRjGyPUEEyQMw+HXm/9kzolxX1t7H3RYXAYMgHWZM/WpYlP khnkkDG7aW3avv9JdMPCO95qtG77P5N6IpX9r53E9jxJi8hILrsnxvMWXpDxARrQKf30 oSimLpbiNwMSQv+zqUGeTuMuWrUyNHpjLvtPLSKu1bcb42IX5+7IcD0XC2Ddf7Hbq9X2 HXMA== X-Gm-Message-State: ACrzQf1JvBhi8Bl4+MIz55yhO7eMjXLN56WFY9SIGBPqqvc0CTqa1e1h 2dKxuBJ0HD+Cn5agSmeGsjg= X-Google-Smtp-Source: AMsMyM5/17xWs9woWWkktxcPqHx3cr+xDcSyI3RrfGuxVtmeb1RZK+SFUBNURp2e36q+5tXAzXtTUg== X-Received: by 2002:a05:6a00:999:b0:56c:3d0d:96fe with SMTP id u25-20020a056a00099900b0056c3d0d96femr11259206pfg.12.1667169174552; Sun, 30 Oct 2022 15:32:54 -0700 (PDT) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id s14-20020a170902ea0e00b001785fa792f4sm3114297plg.243.2022.10.30.15.32.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Oct 2022 15:32:53 -0700 (PDT) Message-ID: <83d4f96f-c13f-0951-6cbd-86f15a88fd69@gmail.com> Date: Sun, 30 Oct 2022 15:32:53 -0700 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files From: Jim Porter To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 10/24/2022 8:10 PM, Jim Porter wrote: > That's how it seems to me too. In that case, I can update the patch I > attached in my original message[1] to fix the bug. If we want to > preserve the current behavior that Emacs 29 has exactly, we could also > add a separate setting for how to handle killing the non-last client; > then the two would be independently customizable. I'm not sure this is > necessary, but if others think it is, I'm happy to write a patch for it. While working through this, I found a tangentially-related bug that occurs regardless of whether 'server-stop-automatically' is set: bug#58909. Since the discussion here is pretty long already, I opted to file a new issue for it, but in practice, it might be easier to write a patch that fixes both this bug and that one; there's a fair amount of crossover in the code for these. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 29 00:31:13 2022 Received: (at 51993) by debbugs.gnu.org; 29 Nov 2022 05:31:13 +0000 Received: from localhost ([127.0.0.1]:53182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oztD6-0003bK-AU for submit@debbugs.gnu.org; Tue, 29 Nov 2022 00:31:12 -0500 Received: from mail-pl1-f180.google.com ([209.85.214.180]:41905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oztD3-0003bE-SX for 51993@debbugs.gnu.org; Tue, 29 Nov 2022 00:31:10 -0500 Received: by mail-pl1-f180.google.com with SMTP id io19so12348990plb.8 for <51993@debbugs.gnu.org>; Mon, 28 Nov 2022 21:31:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:references:cc:to:from:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=HiTgwRJSY9su1z1l9h37VOB9mGPt+DpWZBvkmVuof/o=; b=HlcCgxfx/YPDcY0clo6K0D+PQ4V0r0LYkBDDJg6EGQKDCH/2aerw7cC1YFZ+zkyzrY M/mBGNYvlH71d/2kRMzjyPg9q1O6qRUX4nFaMyTISYcUfMir56nUJXOTdAb337eI8eHD 0zSSaPa8zTZSjfrRTQhvllGU5tiqYYipcoXudB92j7n/I4tMUOc66wQcxd0mMasGqZOE qHMi+jplbl6VuB24xzHYe/BBs8feOdlrAhkFi7jk8G4xDbDqGT2ZZMUmQ72NBpRV7LRx 6yNkYX0MIpWFAVyh8H2Ju1+D+Y8uU9KWqUFzx5e1pp5dcwWFphOIpCEnQj4krjVhNoPI FWsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:cc:to:from:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=HiTgwRJSY9su1z1l9h37VOB9mGPt+DpWZBvkmVuof/o=; b=TKFsEVmIFB2a6zMt46bsd77sPaowPi9A5Jwj/5fl7gr2YCecnqAFstuMKokDitqGXw zwz6c1IAITBvY7HXM12jo8CNiFMXT/OWCBdsf5FnpD1EY0FuO89lAKFz1zXzy4C4xhYy aNB49oHUve2saygrqiOdpvozk6DhMa32PFM88FETWnbzMhhn5x8RiNiAeHFxwwfo64m9 obvobcE81vYjKEe5v5PW8injGz2I/0Ng+JPkkJogA7mFCiP7J0NHb+jpxbSKgqdULQ9k vHvnn1zH4wOalWYN54sqajkGMBji/6tnbQbQRXqsBVwgtiXR2eo9vRRA+ABRQ+4qyDm/ 9/Bw== X-Gm-Message-State: ANoB5pm3sDaYKBO0FdmJth5IRtiFcjzuhd92hzoeHp8BGtpzD7tFQki2 CJaZ3wCG16ee2pUgF5aqzSA= X-Google-Smtp-Source: AA0mqf7XhedoylHeKzxzD2hDLNdeHATaF/HbfvP+aZM3BUkOlHidObzgf4zGSbCN5YRVzUIKv0N2Ag== X-Received: by 2002:a17:902:8217:b0:186:a5a7:cc3d with SMTP id x23-20020a170902821700b00186a5a7cc3dmr34952592pln.42.1669699863857; Mon, 28 Nov 2022 21:31:03 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id b14-20020a170902650e00b0016d773aae60sm9791365plk.19.2022.11.28.21.31.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Nov 2022 21:31:02 -0800 (PST) Content-Type: multipart/mixed; boundary="------------wFUCLtGrkwCqjitYWCG16Gkd" Message-ID: Date: Mon, 28 Nov 2022 21:31:02 -0800 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US From: Jim Porter To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> In-Reply-To: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------wFUCLtGrkwCqjitYWCG16Gkd Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/24/2022 8:10 PM, Jim Porter wrote: > On 10/21/2022 11:57 PM, Eli Zaretskii wrote: >>> Date: Fri, 21 Oct 2022 20:46:47 -0700 >>> Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org >>> From: Jim Porter >>> >>> The issue in the quote above is that if you enable automatic server >>> shutdown in Emacs 29, it changes the behavior of exiting an emacsclient >>> even when it wouldn't stop the server (i.e. when there are other active >>> clients). That's surprising to me, I wouldn't expect that setting to >>> affect cases when it decides *not* to kill the Emacs daemon. >> >> Sounds like a bug to me, because it contradicts what the doc string >> says. > > That's how it seems to me too. ... Ok, after quite a delay, here's a patch for this. Previously, the function 'server-stop-automatically--handle-delete-frame' responded to both 'C-x C-c' ('save-buffers-kill-terminal') and 'delete-frame', which made it more complex. I've moved the 'C-x C-c' case into 'server-save-buffers-kill-terminal', which simplifies 'server-stop-automatically--handle-delete-frame'. The updated 'server-save-buffers-kill-terminal' should now make sure that the new stop-automatically behavior only happens when there are no other client processes (or nowait frames). I've also attached a version of the diff excluding the whitespace changes to make reviewing the code easier. --------------wFUCLtGrkwCqjitYWCG16Gkd Content-Type: text/plain; charset=UTF-8; name="0001-Make-killing-a-non-last-client-work-the-same-no-matt.patch" Content-Disposition: attachment; filename*0="0001-Make-killing-a-non-last-client-work-the-same-no-matt.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAyYzA5NDBhODZjZDExZWJhZDBkMWVhN2ZjZjhmZTJlOWNmYmMwZmIzIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IE1vbiwgMjggTm92IDIwMjIgMjE6MTc6NTkgLTA4MDAKU3ViamVjdDogW1BB VENIXSBNYWtlIGtpbGxpbmcgYSBub24tbGFzdCBjbGllbnQgd29yayB0aGUgc2FtZSBubyBt YXR0ZXIgdGhlCiBhdXRvLXN0b3Agc2V0dGluZwoKUHJldmlvdXNseSwgaWYgJ3NlcnZlci1z dG9wLWF1dG9tYXRpY2FsbHknIHdhcyBjb25maWd1cmVkIGZvcgona2lsbC10ZXJtaW5hbCcg b3IgJ2RlbGV0ZS1mcmFtZScsIGtpbGxpbmcgYS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bWUuCisJICAgICAgIChwcm9n biAoc2F2ZS1zb21lLWJ1ZmZlcnMgYXJnKQorCQkgICAgICAoZGVsZXRlLWZyYW1lKSkKKwkg ICAgIDs7IElmIHdlJ3JlIHRoZSBsYXN0IGZyYW1lIHN0YW5kaW5nLCBraWxsIEVtYWNzLgor CSAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVtYWNzIGFyZykpKQorCSAgKChwcm9jZXNzcCBw cm9jKQorICAgICAgICAgICAoaWYgKG9yIChub3Qgc2VydmVyLXN0b3AtYXV0b21hdGljYWxs eSkKKyAgICAgICAgICAgICAgICAgICAobGVuZ3RoPiBzZXJ2ZXItY2xpZW50cyAxKQorICAg ICAgICAgICAgICAgICAgIChzZXEtc29tZQorICAgICAgICAgICAgICAgICAgICAobGFtYmRh IChmcmFtZSkKKyAgICAgICAgICAgICAgICAgICAgICAod2hlbi1sZXQgKChwIChmcmFtZS1w YXJhbWV0ZXIgZnJhbWUgJ2NsaWVudCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgKG5v dCAoZXEgcHJvYyBwKSkpKQorICAgICAgICAgICAgICAgICAgICAoZnJhbWUtbGlzdCkpKQor CSAgICAgICAobGV0ICgoYnVmZmVycyAocHJvY2Vzcy1nZXQgcHJvYyAnYnVmZmVycykpKQor CSAgICAgICAgIChzYXZlLXNvbWUtYnVmZmVycworCSAgICAgICAgICBhcmcgKGlmIGJ1ZmZl cnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgT25seSBmaWxlcyBmcm9tIGVtYWNz Y2xpZW50IGZpbGUgbGlzdC4KKwkJICAgICAgICAgIChsYW1iZGEgKCkgKG1lbXEgKGN1cnJl bnQtYnVmZmVyKSBidWZmZXJzKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIDs7IE5vIGVt YWNzY2xpZW50IGZpbGUgbGlzdDogZG9uJ3Qgb3ZlcnJpZGUKKyAgICAgICAgICAgICAgICAg ICAgICAgIDs7IGBzYXZlLXNvbWUtYnVmZmV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JyBpcyB1c2Vk LiIKLS0gCjIuMjUuMQoK --------------wFUCLtGrkwCqjitYWCG16Gkd Content-Type: text/plain; charset=UTF-8; name="no-whitespace-change.diff" Content-Disposition: attachment; filename="no-whitespace-change.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3Avc2VydmVyLmVsIGIvbGlzcC9zZXJ2ZXIuZWwKaW5kZXggMWIw MjdmODhjZS4uZTg4Y2ZmYThmYiAxMDA2NDQKLS0tIGEvbGlzcC9zZXJ2ZXIuZWwKKysrIGIv bGlzcC9zZXJ2ZXIuZWwKQEAgLTE3ODAsMTcgKzE3ODAsMjUgQEAgc2VydmVyLXNhdmUtYnVm ZmVycy1raWxsLXRlcm1pbmFsCiAKIElmIGVtYWNzY2xpZW50IHdhcyBzdGFydGVkIHdpdGgg YSBsaXN0IG9mIGZpbGVuYW1lcyB0byBlZGl0LCB0aGVuCiBvbmx5IHRoZXNlIGZpbGVzIHdp bGwgYmUgYXNrZWQgdG8gYmUgc2F2ZWQuIgotICAoaWYgc2VydmVyLXN0b3AtYXV0b21hdGlj YWxseQotICAgICAgKHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHktLWhhbmRsZS1kZWxldGUt ZnJhbWUgKHNlbGVjdGVkLWZyYW1lKSkKICAgKGxldCAoKHByb2MgKGZyYW1lLXBhcmFtZXRl ciBuaWwgJ2NsaWVudCkpKQogICAgIChjb25kICgoZXEgcHJvYyAnbm93YWl0KQogCSAgIDs7 IE5vd2FpdCBmcmFtZXMgaGF2ZSBubyBjbGllbnQgYnVmZmVyIGxpc3QuCi0JICAgICAoaWYg KGNkciAoZnJhbWUtbGlzdCkpCisJICAgKGlmIChsZW5ndGg+IChmcmFtZS1saXN0KSAoaWYg c2VydmVyLXN0b3AtYXV0b21hdGljYWxseSAyIDEpKQorICAgICAgICAgICAgICAgOzsgSWYg dGhlcmUgYXJlIGFueSBvdGhlciBmcmFtZXMsIG9ubHkgZGVsZXRlIHRoaXMgb25lLgorICAg ICAgICAgICAgICAgOzsgV2hlbiBgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseScgaXMgc2V0 LCBkb24ndCBjb3VudAorICAgICAgICAgICAgICAgOzsgdGhlIGRhZW1vbiBmcmFtZS4KIAkg ICAgICAgKHByb2duIChzYXZlLXNvbWUtYnVmZmVycyBhcmcpCiAJCSAgICAgIChkZWxldGUt ZnJhbWUpKQogCSAgICAgOzsgSWYgd2UncmUgdGhlIGxhc3QgZnJhbWUgc3RhbmRpbmcsIGtp bGwgRW1hY3MuCiAJICAgICAoc2F2ZS1idWZmZXJzLWtpbGwtZW1hY3MgYXJnKSkpCiAJICAo KHByb2Nlc3NwIHByb2MpCisgICAgICAgICAgIChpZiAob3IgKG5vdCBzZXJ2ZXItc3RvcC1h dXRvbWF0aWNhbGx5KQorICAgICAgICAgICAgICAgICAgIChsZW5ndGg+IHNlcnZlci1jbGll bnRzIDEpCisgICAgICAgICAgICAgICAgICAgKHNlcS1zb21lCisgICAgICAgICAgICAgICAg ICAgIChsYW1iZGEgKGZyYW1lKQorICAgICAgICAgICAgICAgICAgICAgICh3aGVuLWxldCAo KHAgKGZyYW1lLXBhcmFtZXRlciBmcmFtZSAnY2xpZW50KSkpCisgICAgICAgICAgICAgICAg ICAgICAgICAobm90IChlcSBwcm9jIHApKSkpCisgICAgICAgICAgICAgICAgICAgIChmcmFt ZS1saXN0KSkpCiAJICAgICAgIChsZXQgKChidWZmZXJzIChwcm9jZXNzLWdldCBwcm9jICdi dWZmZXJzKSkpCiAJICAgICAgICAgKHNhdmUtc29tZS1idWZmZXJzCiAJICAgICAgICAgIGFy ZyAoaWYgYnVmZmVycwpAQCAtMTgwMSwzMSArMTgwOSwyMCBAQCBzZXJ2ZXItc2F2ZS1idWZm ZXJzLWtpbGwtdGVybWluYWwKICAgICAgICAgICAgICAgICAgICAgICAgIDs7IEFSRyBpcyBu b24tbmlsKSwgc2luY2Ugd2UncmUgbm90IGtpbGxpbmcKICAgICAgICAgICAgICAg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ChlcSAoZnJhbWUtcGFyYW1ldGVyIGZyYW1lICdjbGllbnQpCi0JCQkgICAg ICAgKGZyYW1lLXBhcmFtZXRlciBmICdjbGllbnQpKQotCQkJICAgKG5vdCAoZXEgZnJhbWUg ZikpKQotCQkgIChzZXQtZnJhbWUtcGFyYW1ldGVyIGYgJ2NsaWVudCBuaWwpCi0JCSAgKGxl dCAoKHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkgbmlsKSkKLQkJICAgIChkZWxldGUtZnJh bWUgZikpKSkKLQkgICAgICAoaWYgKGNkZHIgKGZyYW1lLWxpc3QpKQotCQkgIChsZXQgKChz ZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5IG5pbCkpCi0JCSAgICAoZGVsZXRlLWZyYW1lIGZy YW1lKQotCQkgICAgbmlsKQotCQl0KSkKKyAgKHdoZW4gKGFuZCBzZXJ2ZXItc3RvcC1hdXRv bWF0aWNhbGx5CiAgICAgICAgICAgICAgKG51bGwgKGNkZHIgKGZyYW1lLWxpc3QpKSkpCiAg ICAgKGxldCAoKHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkgbmlsKSkKICAgICAgIChzYXZl LWJ1ZmZlcnMta2lsbC1lbWFjcykKLQkgIChkZWxldGUtZnJhbWUgZnJhbWUpKSkpKQorICAg ICAgKGRlbGV0ZS1mcmFtZSBmcmFtZSkpKSkKIAogKGRlZnVuIHNlcnZlci1zdG9wLWF1dG9t YXRpY2FsbHktLW1heWJlLWtpbGwtZW1hY3MgKCkKICAgIkhhbmRsZSBjbG9zaW5nIG9mIEVt YWNzIGRhZW1vbiB3aGVuIGBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5JyBpcyB1c2VkLiIK --------------wFUCLtGrkwCqjitYWCG16Gkd-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 01 12:30:12 2022 Received: (at 51993) by debbugs.gnu.org; 1 Dec 2022 17:30:12 +0000 Received: from localhost ([127.0.0.1]:40962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0nNx-0008Kq-VP for submit@debbugs.gnu.org; Thu, 01 Dec 2022 12:30:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0nNt-0008Jd-7T for 51993@debbugs.gnu.org; Thu, 01 Dec 2022 12:30:08 -0500 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 1p0nNn-0001jq-LE; Thu, 01 Dec 2022 12:29:59 -0500 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=/3Akg14VzA/dc7JweEXVYVl4ScPCAtDVcVE/g715zrg=; b=cR40Zg0s9fbc 7y7Pxu3J7VcR2SEaofqF94hCsIlnHWVZPJ6f5A73x8pPBpiwNq38mbQkjaYZF+U1DIyNjLOxBmXBE MGFD6Sh1i0NwKdMmwT75gvpq8wLXwpyM/wIGbqgPcUJ8K+HIyg3NrmMwGRObjmASTpfT5T4pRPZ9b bGKrORmsRP3FkgIV1jfQe+5b3sXZWrbDuS+tHwCwMcqRIm0qXNhmhF3/88o+ihYOa03cK2l+LzynU +9gzm8YKtlKItIki5KtuvTbm6OkAQlDbbV6onUJFDA5M79o0G3c0UyeBIFJS2AxibfxNBO2hxDaI5 dZzuiOcZVRTk4NdAH7aQ3w==; 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 1p0nNm-00048u-Kc; Thu, 01 Dec 2022 12:29:59 -0500 Date: Thu, 01 Dec 2022 19:29:31 +0200 Message-Id: <83lenrghhg.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: (message from Jim Porter on Mon, 28 Nov 2022 21:31:02 -0800) Subject: Re: bug#51993: 29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 28 Nov 2022 21:31:02 -0800 > From: Jim Porter > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > > >>> The issue in the quote above is that if you enable automatic server > >>> shutdown in Emacs 29, it changes the behavior of exiting an emacsclient > >>> even when it wouldn't stop the server (i.e. when there are other active > >>> clients). That's surprising to me, I wouldn't expect that setting to > >>> affect cases when it decides *not* to kill the Emacs daemon. > >> > >> Sounds like a bug to me, because it contradicts what the doc string > >> says. > > > > That's how it seems to me too. ... > Ok, after quite a delay, here's a patch for this. Previously, the > function 'server-stop-automatically--handle-delete-frame' responded to > both 'C-x C-c' ('save-buffers-kill-terminal') and 'delete-frame', which > made it more complex. I've moved the 'C-x C-c' case into > 'server-save-buffers-kill-terminal', which simplifies > 'server-stop-automatically--handle-delete-frame'. > > The updated 'server-save-buffers-kill-terminal' should now make sure > that the new stop-automatically behavior only happens when there are no > other client processes (or nowait frames). We want this on the release branch, right? Then please make it the minimal change which fixes the immediate cause of the bug, and does nothing else: no refactoring, no reshuffling of the code or making it nicer or less complicated -- all that just makes the risk of new bugs higher and the job of reviewing the patch harder. > + (if (length> (frame-list) (if server-stop-automatically 2 1)) > + ;; If there are any other frames, only delete this one. > + ;; When `server-stop-automatically' is set, don't count > + ;; the daemon frame. > (progn (save-some-buffers arg) > (delete-frame)) > ;; If we're the last frame standing, kill Emacs. > (save-buffers-kill-emacs arg))) This part is easily understood. > ((processp proc) > + (if (or (not server-stop-automatically) > + (length> server-clients 1) > + (seq-some > + (lambda (frame) > + (when-let ((p (frame-parameter frame 'client))) > + (not (eq proc p)))) > + (frame-list))) > (let ((buffers (process-get proc 'buffers))) > (save-some-buffers > arg (if buffers This part is also easily understood. > @@ -1801,31 +1809,20 @@ server-save-buffers-kill-terminal > ;; ARG is non-nil), since we're not killing > ;; Emacs (unlike `save-buffers-kill-emacs'). > (and arg t))) > - (server-delete-client proc))) > - (t (error "Invalid client frame")))))) > + (server-delete-client proc)) > + ;; If `server-stop-automatically' is set, there are no > + ;; other client processes, and no other client frames > + ;; (e.g. `nowait' frames), kill Emacs. > + (save-buffers-kill-emacs arg))) > + (t (error "Invalid client frame"))))) But this one is problematic: it adds save-buffers-kill-emacs which wasn't in the original code, and I don't understand why. The bug wasn't about this, was it? > (defun server-stop-automatically--handle-delete-frame (frame) > "Handle deletion of FRAME when `server-stop-automatically' is used." > - (when server-stop-automatically > - (if (if (and (processp (frame-parameter frame 'client)) > - (eq this-command 'save-buffers-kill-terminal)) > - (progn > - (dolist (f (frame-list)) > - (when (and (eq (frame-parameter frame 'client) > - (frame-parameter f 'client)) > - (not (eq frame f))) > - (set-frame-parameter f 'client nil) > - (let ((server-stop-automatically nil)) > - (delete-frame f)))) > - (if (cddr (frame-list)) > - (let ((server-stop-automatically nil)) > - (delete-frame frame) > - nil) > - t)) > + (when (and server-stop-automatically > (null (cddr (frame-list)))) > (let ((server-stop-automatically nil)) > (save-buffers-kill-emacs) > - (delete-frame frame))))) > + (delete-frame frame)))) And here you completely rewrote a function. I'm okay with installing the original changes on master, if you indeed believe the new code is much cleaner (but then please explain why you think so, because I don't think I see that just by looking at the diffs). But for the release branch, I'm not comfortable with making such serious changes in a part of server.el that is already way too complicated, what with all the fancy shutdown options we strive to support. There be dragons, and I have no intention to release Emacs 29 with buggy server-client editing. So for the release branch, please prepare a safer version of the change, which only changes the code which is the immediate cause of the incorrect behavior. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 01 20:09:37 2022 Received: (at 51993) by debbugs.gnu.org; 2 Dec 2022 01:09:37 +0000 Received: from localhost ([127.0.0.1]:43021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0uYa-00047D-EU for submit@debbugs.gnu.org; Thu, 01 Dec 2022 20:09:36 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:35425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0uYX-000476-6u for 51993@debbugs.gnu.org; Thu, 01 Dec 2022 20:09:34 -0500 Received: by mail-pj1-f45.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso6919243pjt.0 for <51993@debbugs.gnu.org>; Thu, 01 Dec 2022 17:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=Mut6/v0WZX6H6vjNNb5qbPbGk1aHslPEn9cLqviA+bI=; b=Z5vt0AR0OP5AIdheQDhxLmvr2fo3zpYofjJtVoa6QEKGYfMBKw7m4jlRd9CzUJlIt3 pYOIP2w4HSf6OkydCC+DXWcP5URP2mYbrRXWURBJi87GgJ3bgv2ttt3Nwxux9nHuR9I2 +fHwfJwmOwotAoDC175EGl4aWuFIQ4seR28iZg2eOugFOcXBWj2TsHsLa5gZpy1VaK9H FhIttujJc9pWiCMnI6ydyJdwOxty17W8mbUNucE/iGeBRdGWiZDeBWywYuYhWep2XCIW IE/ZijVJSJjboAzYyTB/DaBDKu0ZsQPkYvLRR5w+SxiqvdD+2Cf9WDqhl+ieNQS1kv5v StdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Mut6/v0WZX6H6vjNNb5qbPbGk1aHslPEn9cLqviA+bI=; b=AZ87ad/XsCtHvgH5/ip3ipXTIEgPefn1HOQ/xH+ytxelgpcn4/QKbwPep8wLWRcJ25 SfIj05JHRDmgTAJTcPmkVtjLF5ylAa1Tag6dzAF1rZeNDpIROOsATSY/Kz/ugAzTQBaI DmlufhAX+i012u/RUMY8Bga09N8Xmwei3A3FXNim1C9LZFC12LtT733Q1hIcnYbhx1x5 AhpPfukLGBaTiEtbcMiQSSP6KjRl43xN5eCAJz8jHFgv9YyzkkJlwAmJ04YplKbg/yzi CpwfLDA1BS7sHuqYYCmk20p0Rsech2ZeHYLv+lU0I63iB8rYOyI1iynAxn5HpL4BruGd KOGg== X-Gm-Message-State: ANoB5pk5jMnUyy3Tb2D/s1LyqfJzRP3/brimT7pLjJbpfRNYm3Gebdp4 cdNkWHA3SLHkclxCo4AKB7Y= X-Google-Smtp-Source: AA0mqf5+F/ydVuvwV1eoCJS/oy8ftmNkM7lvFpsbcwpy2JUR+f/HVmrySz7iQ+pnr7kkRC0Z5DDQzA== X-Received: by 2002:a17:90b:ed1:b0:210:a844:217c with SMTP id gz17-20020a17090b0ed100b00210a844217cmr74733229pjb.150.1669943367166; Thu, 01 Dec 2022 17:09:27 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id u2-20020a170902e80200b0018980f14940sm4273291plg.178.2022.12.01.17.09.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Dec 2022 17:09:26 -0800 (PST) Content-Type: multipart/mixed; boundary="------------mz2pxLnUwNZjD3580PwCUiid" Message-ID: <8e62e7aa-7050-6b35-9128-79517efa4557@gmail.com> Date: Thu, 1 Dec 2022 17:09:24 -0800 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH for 29.1] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> From: Jim Porter In-Reply-To: <83lenrghhg.fsf@gnu.org> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------mz2pxLnUwNZjD3580PwCUiid Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/1/2022 9:29 AM, Eli Zaretskii wrote: >> Date: Mon, 28 Nov 2022 21:31:02 -0800 >> From: Jim Porter >> Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org >> >>>>> The issue in the quote above is that if you enable automatic server >>>>> shutdown in Emacs 29, it changes the behavior of exiting an emacsclient >>>>> even when it wouldn't stop the server (i.e. when there are other active >>>>> clients). That's surprising to me, I wouldn't expect that setting to >>>>> affect cases when it decides *not* to kill the Emacs daemon. >>>> >>>> Sounds like a bug to me, because it contradicts what the doc string >>>> says. >>> >>> That's how it seems to me too. ... >> Ok, after quite a delay, here's a patch for this. Previously, the >> function 'server-stop-automatically--handle-delete-frame' responded to >> both 'C-x C-c' ('save-buffers-kill-terminal') and 'delete-frame', which >> made it more complex. I've moved the 'C-x C-c' case into >> 'server-save-buffers-kill-terminal', which simplifies >> 'server-stop-automatically--handle-delete-frame'. >> >> The updated 'server-save-buffers-kill-terminal' should now make sure >> that the new stop-automatically behavior only happens when there are no >> other client processes (or nowait frames). > > We want this on the release branch, right? Then please make it the minimal > change which fixes the immediate cause of the bug, and does nothing else: no > refactoring, no reshuffling of the code or making it nicer or less > complicated -- all that just makes the risk of new bugs higher and the job > of reviewing the patch harder. Thanks for taking a look. I believe we'd want this on the release branch. Here's the absolute minimum I could manage, although it doesn't quite fix everything that my previous patch does. In particular, when server-stop-automatically is set to 'kill-terminal' (or 'delete-frame'): * If you type 'C-x C-c' ('save-buffers-kill-terminal') in a nowait client frame, and there are still other (non-daemon) frames, nothing happens. You'd have to use 'C-x 5 0' ('delete-frame') instead. Fixing this would basically mean doing 90% of my original patch, so it's probably too risky. * If you type 'C-u C-x C-c', it doesn't silently save all the relevant buffers. That's because 'server-save-buffers-kill-terminal' doesn't forward the prefix arg to 'server-stop-automatically--handle-delete-frame'. That's a separate (but closely related) bug, so I didn't fix that either. In a followup message, I'll show the breakdown of my previous patch into smaller steps with some more detailed explanation of why I think it simplifies things enough to be worth making the change on the master branch. --------------mz2pxLnUwNZjD3580PwCUiid Content-Type: text/plain; charset=UTF-8; name="0001-Make-killing-a-non-last-client-work-the-same-no-matt.patch" Content-Disposition: attachment; filename*0="0001-Make-killing-a-non-last-client-work-the-same-no-matt.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAxOThmOThiNDNkNWRkZTM0Nzc1MDEwYWM5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kg ICAobm90IChlcSBmcmFtZSBmKSkpCi0JCSAgKHNldC1mcmFtZS1wYXJhbWV0ZXIgZiAnY2xp ZW50IG5pbCkKLQkJICAobGV0ICgoc2VydmVyLXN0b3AtYXV0b21hdGljYWxseSBuaWwpKQot CQkgICAgKGRlbGV0ZS1mcmFtZSBmKSkpKQotCSAgICAgIChpZiAoY2RkciAoZnJhbWUtbGlz dCkpCi0JCSAgKGxldCAoKHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkgbmlsKSkKLQkJICAg IChkZWxldGUtZnJhbWUgZnJhbWUpCi0JCSAgICBuaWwpCi0JCXQpKQorICAgICAgICAgICAg KGxldCogKChwcm9jIChmcmFtZS1wYXJhbWV0ZXIgZnJhbWUgJ2NsaWVudCkpCisgICAgICAg ICAgICAgICAgICAgOzsgS2VlcCB0aGUgc2VydmVyIGFsaXZlIGlmLi4uCisgICAgICAgICAg ICAgICAgICAgKGtlZXAtc2VydmVyLWFsaXZlLXAKKyAgICAgICAgICAgICAgICAgICAgKG9y CisgICAgICAgICAgICAgICAgICAgICA7OyBhKSB0aGVyZSBhcmUgYW55IG90aGVyIGNsaWVu dHMsIG9yLi4uCisgICAgICAgICAgICAgICAgICAgICAobGVuZ3RoPiBzZXJ2ZXItY2xpZW50 cyAxKQorICAgICAgICAgICAgICAgICAgICAgOzsgYikgdGhlcmUgYXJlIGFueSBmcmFtZXMg bm90IG93bmVkIGJ5IHRoaXMKKyAgICAgICAgICAgICAgICAgICAgIDs7IGNsaWVudC4KKyAg ICAgICAgICAgICAgICAgICAgIChzZXEtc29tZQorICAgICAgICAgICAgICAgICAgICAgIChs YW1iZGEgKGZyYW1lKQorICAgICAgICAgICAgICAgICAgICAgICAgKHdoZW4tbGV0ICgocCAo ZnJhbWUtcGFyYW1ldGVyIGZyYW1lICdjbGllbnQpKSkKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgKG5vdCAoZXEgcHJvYyBwKSkpKQorICAgICAgICAgICAgICAgICAgICAgIChmcmFt ZS1saXN0KSkpKSkKKyAgICAgICAgICAgICAgKHdoZW4ga2VlcC1zZXJ2ZXItYWxpdmUtcAor ICAgICAgICAgICAgICAgIDs7IElmIHdlIHdhbnQgdG8ga2VlcCB0aGUgc2VydmVyIGFsaXZl LCBkb24ndCBraWxsCisgICAgICAgICAgICAgICAgOzsgRW1hY3MuICBJbnN0ZWFkLCBqdXN0 IGNhbGwgYHNhdmUtc29tZS1idWZmZXJzJyBhbmQKKyAgICAgICAgICAgICAgICA7OyBkZWxl dGUgdGhlIGNsaWVudCwgYXMgaW4KKyAgICAgICAgICAgICAgICA7OyBgc2VydmVyLXNhdmUt YnVmZmVycy1raWxsLXRlcm1pbmFsJyBhYm92ZS4KKyAgICAgICAgICAgICAgICAobGV0ICgo YnVmZmVycyAocHJvY2Vzcy1nZXQgcHJvYyAnYnVmZmVycykpKQorCSAgICAgICAgICAoc2F2 ZS1zb21lLWJ1ZmZlcnMKKyAgICAgICAgICAgICAgICAgICBuaWwgKGlmIGJ1ZmZlcnMKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgIChsYW1iZGEgKCkgKG1lbXEgKGN1cnJlbnQtYnVm ZmVyKSBidWZmZXJzKSkpKQorCSAgICAgICAgICAoc2VydmVyLWRlbGV0ZS1jbGllbnQgcHJv YykpKQorICAgICAgICAgICAgICA7OyBUZWxsIHRoZSBvdXRlciBgaWYnIGJsb2NrIHdoZXRo ZXIgd2Ugd2FudCB0byBraWxsCisgICAgICAgICAgICAgIDs7IEVtYWNzLgorICAgICAgICAg ICAgICAobm90IGtlZXAtc2VydmVyLWFsaXZlLXApKQogCSAgKG51bGwgKGNkZHIgKGZyYW1l LWxpc3QpKSkpCiAJKGxldCAoKHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkgbmlsKSkKIAkg IChzYXZlLWJ1ZmZlcnMta2lsbC1lbWFjcykKLS0gCjIuMjUuMQoK --------------mz2pxLnUwNZjD3580PwCUiid-- From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 01 20:42:29 2022 Received: (at 51993) by debbugs.gnu.org; 2 Dec 2022 01:42:29 +0000 Received: from localhost ([127.0.0.1]:43165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0v4O-0004QF-JK for submit@debbugs.gnu.org; Thu, 01 Dec 2022 20:42:29 -0500 Received: from mail-pj1-f53.google.com ([209.85.216.53]:37866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0v4M-0004Q9-6w for 51993@debbugs.gnu.org; Thu, 01 Dec 2022 20:42:27 -0500 Received: by mail-pj1-f53.google.com with SMTP id k2-20020a17090a4c8200b002187cce2f92so6929372pjh.2 for <51993@debbugs.gnu.org>; Thu, 01 Dec 2022 17:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=vjFhW/4czrlPuvA9a6Z5FVhKqEkpSPM5eZlP+hB/GkA=; b=oFBaPBnCYyPmZZ/+JFUP8XAqkAEElSvQKoEjPSWV4/hcXgqxG+C/v7TkPWXfvskw3Y Ru8d3YWBDckHS+qmAoHuxN7sLs0GvJPf3IKTr7d9gh2H+0lbHtj3wOnY6TFZBZ2n2ihK PvuRnSBQa8HDqPFkPo0Nefjll2Y1fswR25MWrdGUYDaZ+GzOsULZb28WB9hdPky4/Cy5 xRS7CxxowoMCd1CWNu70QbIeYvJEoBCTWX/XBWFrbHaJmCIS508ZH/0h9ghqoGfAwLEC Zp1sCYZvqnXmnitYoOJgP3hN8U+JukxOthTtdYtJY34LIpBevl7dYrtOufCMpIIOEEO4 ROHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=vjFhW/4czrlPuvA9a6Z5FVhKqEkpSPM5eZlP+hB/GkA=; b=q1ifDRcX4wUfMB2jUnk92YrClFECzTOi2Yd86LLox1DzCws5OnI3N2l/sN5ZuUqqBh 5si54xvibTmP1JPztovSbdkzimHDMp0lwEtWbSH/VJ7adO8SMy1pVJBEX/Vp6ryycV56 Jzv7NCzilZi7iFK1dXMulPKeOLz/oO/b5+fMAsJQ0V31Y3HXeqlh7QOUT0Z5A9NDnSVt OJlllVq9QBcc7LeGpiBRp0f4Q48kyY6GVu3kROFTGBuUX0KJqt9YoswVpq+InPGEWkKp 12qcVMNFz1TXP+rSuo+se86e9opV2mgAJGkc4z2DjMxQTan/AnzXgxLicSbdnj14TK80 +D/A== X-Gm-Message-State: ANoB5pnnrreBUQBgc6kMl0zBn0NpdGd3MfayNHM8NFIKqgkl4P0wCBjH H6S3Cx0nQDjDveu+rbWYF/s= X-Google-Smtp-Source: AA0mqf6hWK4fgwTWAkTL4M4uJ1cQM09Nna30NBSdjYnZAi8IDH0BVIkhaDTpDxSxkj8N70GFX3yqig== X-Received: by 2002:a17:902:bb84:b0:184:e4db:e3e with SMTP id m4-20020a170902bb8400b00184e4db0e3emr53707820pls.47.1669945340089; Thu, 01 Dec 2022 17:42:20 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id l12-20020a17090a850c00b0020ae09e9724sm3607530pjn.53.2022.12.01.17.42.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Dec 2022 17:42:19 -0800 (PST) Content-Type: multipart/mixed; boundary="------------kP04AvxyTSEJW1KPGKYjpSB1" Message-ID: <30673991-caf6-afeb-ec05-d70d6fc45f48@gmail.com> Date: Thu, 1 Dec 2022 17:42:18 -0800 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH explanation] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> From: Jim Porter In-Reply-To: <83lenrghhg.fsf@gnu.org> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/1/2022 9:29 AM, Eli Zaretskii wrote: > I'm okay with installing the original changes on master, if you indeed > believe the new code is much cleaner (but then please explain why you think > so, because I don't think I see that just by looking at the diffs). But for > the release branch, I'm not comfortable with making such serious changes in > a part of server.el that is already way too complicated, what with all the > fancy shutdown options we strive to support. There be dragons, and I have > no intention to release Emacs 29 with buggy server-client editing. So for > the release branch, please prepare a safer version of the change, which only > changes the code which is the immediate cause of the incorrect behavior. Attached is a patch series that explains in more detail how I arrived at the previous version of my patch. This is basically a reconstruction of the steps I took when writing it originally. I'll describe my overall plan and then address the specific comments you had after that. (This might be overly-verbose, but I wanted to put as much detail in as I could in the hopes of addressing all your concerns.) Prior to my patch, 'server-stop-automatically--handle-delete-frame' (henceforth 'SSA--handle-delete-frame') can get called in two situations: when someone calls 'delete-frame' (it's a hook on 'delete-frame-functions') or when someone calls 'save-buffers-kill-emacs' ('server-save-buffers-kill-emacs' delegates to it when configured to). To help make the logic easier to follow, I split it into two: one for handling 'delete-frame', and one for handling 'save-buffers-kill-terminal'. See patches 0001 and 0002. >> (defun server-stop-automatically--handle-delete-frame (frame) >> "Handle deletion of FRAME when `server-stop-automatically' is used." >> - (when server-stop-automatically >> - (if (if (and (processp (frame-parameter frame 'client)) >> - (eq this-command 'save-buffers-kill-terminal)) >> - (progn >> - (dolist (f (frame-list)) >> - (when (and (eq (frame-parameter frame 'client) >> - (frame-parameter f 'client)) >> - (not (eq frame f))) >> - (set-frame-parameter f 'client nil) >> - (let ((server-stop-automatically nil)) >> - (delete-frame f)))) >> - (if (cddr (frame-list)) >> - (let ((server-stop-automatically nil)) >> - (delete-frame frame) >> - nil) >> - t)) >> + (when (and server-stop-automatically >> (null (cddr (frame-list)))) >> (let ((server-stop-automatically nil)) >> (save-buffers-kill-emacs) >> - (delete-frame frame))))) >> + (delete-frame frame)))) > > And here you completely rewrote a function. In patch 0002, you can see (most of) this change that you mentioned: since I made one function for each case as described above, the second 'if' statement's conditional is always false, so I just got rid of the conditional and the then-clause, leaving only the else-clause: (null (cddr (frame-list))). I also simplified this function a bit in the last patch, 0007. Now for the rest of the patch series. The original bug is that the behavior of 'server-save-buffers-kill-terminal' when there are multiple clients should be the same regardless of the SSA setting (it wasn't). So next, I made 'SSA--handle-kill-terminal' have the same basic structure as 'server-save-buffers-kill-terminal' (patch 0003). That makes it easier to see the differences between the two. Patch 0005 is where the real fix is: it makes sure that when we *don't* want to kill Emacs, 'SSA--handle-kill-terminal' does the same thing as 'server-save-buffers-kill-terminal'. >> @@ -1801,31 +1809,20 @@ server-save-buffers-kill-terminal >> ;; ARG is non-nil), since we're not killing >> ;; Emacs (unlike `save-buffers-kill-emacs'). >> (and arg t))) >> - (server-delete-client proc))) >> - (t (error "Invalid client frame")))))) >> + (server-delete-client proc)) >> + ;; If `server-stop-automatically' is set, there are no >> + ;; other client processes, and no other client frames >> + ;; (e.g. `nowait' frames), kill Emacs. >> + (save-buffers-kill-emacs arg))) >> + (t (error "Invalid client frame"))))) > > But this one is problematic: it adds save-buffers-kill-emacs which wasn't in > the original code, and I don't understand why. The bug wasn't about this, > was it? In patch 0005, you can start to see this block of code take shape: because we want to handle the "don't kill Emacs" case in 'SSA--handle-kill-terminal', we add the 'save-some-buffers' + 'server-delete-client' code there, resulting in something that looks similar to the above hunk. Then, in patch 0006, I just merge 'server-save-buffers-kill-terminal' and 'SSA--handle-kill-terminal', since most of the code is shared at this point. Finally, patch 0007 is just a bit of cleanup; with all of these applied, server.el should be identical to my previous patch. Hopefully this explains things reasonably well, and doesn't go into too much (or too little) detail. If there are any other bits that you have concerns about, just let me know. --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; name="0001-Duplicate-server-stop-automatically-handle-delete-fr.patch" Content-Disposition: attachment; filename*0="0001-Duplicate-server-stop-automatically-handle-delete-fr.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA3NGM3MjRhNDZiMTY3ODJkNjgyNzM1N2RkNjRlZmJhZmU4YWViOTJmIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFRodSwgMSBEZWMgMjAyMiAxMTozMzoxOCAtMDgwMApTdWJqZWN0OiBbUEFU Q0ggMS83XSBEdXBsaWNhdGUKICdzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5LS1oYW5kbGUt ZGVsZXRlLWZyYW1lJwoKKiBsaXNwL3NlcnZlci5lbCAoc2VydmVyLXN0b3AtYXV0b21hdGlj YWxseS0taGFuZGxlLWRlbGV0ZS1mcmFtZSk6CkNvcHkgdGhpcy4uLgooc2VydmVyLXN0b3At YXV0b21hdGljYWxseS0taGFuZGxlLWtpbGwtdGVybWluYWwpIC4uLiB0byB0aGlzLgooc2Vy dmVyLXNhdmUtYnVmZ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lsKSkKKwkgIChzYXZlLWJ1ZmZlcnMta2lsbC1lbWFjcykKKwkgIChkZWxldGUt ZnJhbWUgZnJhbWUpKSkpKQorCiAoZGVmdW4gc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0t bWF5YmUta2lsbC1lbWFjcyAoKQogICAiSGFuZGxlIGNsb3Npbmcgb2YgRW1hY3MgZGFlbW9u IHdoZW4gYHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHknIGlzIHVzZWQuIgogICAodW5sZXNz IChjZHIgKGZyYW1lLWxpc3QpKQotLSAKMi4yNS4xCgo= --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; name="0002-Simplify-server-stop-automatically-handlers.patch" Content-Disposition: attachment; filename="0002-Simplify-server-stop-automatically-handlers.patch" Content-Transfer-Encoding: base64 RnJvbSBiZTBiNDU1NmI5Y2IxYWI4ODJkN2U2Y2U1ZTg1ZGQyMGNmZGM5ZDk2IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFRodSwgMSBEZWMgMjAyMiAxMTozNTowMCAtMDgwMApTdWJqZWN0OiBbUEFU Q0ggMi83XSBTaW1wbGlmeSBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5IGhhbmRsZXJzCgoq IGxpc3Avc2VydmVyLmVsIChzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5LS1oYW5kbGUtZGVs ZXRlLWZyYW1lKToKJ3RoaXMtY29tbWFuZCcgaXMgbmV2ZXIgJ3NhdmUtYnVmZmVycy1raWxs LXRlcm1pbmFsJyBoZXJlOyByZW1vdmUKdGhlIHdob2xlIGNvbmRpdGlvbmFsLgooc2VydmVy LXN0b3AtYXV0b21hdGljYWxseS0taGFuZGxlLWtpbGwtdGVybWluYWwpOiAndGhpcy1jb21t YW5kJyBpcwphbHdheXMgJ3NhdmUt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JhbWUtbGlzdCkpCiAJCSh3aGVuIChhbmQgKGVxIChmcmFtZS1wYXJh bWV0ZXIgZnJhbWUgJ2NsaWVudCkKLS0gCjIuMjUuMQoK --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; name="0003-Restructure-server-stop-automatically-handle-kill-te.patch" Content-Disposition: attachment; filename*0="0003-Restructure-server-stop-automatically-handle-kill-te.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBkYjBjZmZiODQ5YzBhMGJlNTBkYjdhZDRhM2EwZDQ4ZmYzNDM4NTRiIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFRodSwgMSBEZWMgMjAyMiAxMTo0Mjo0OCAtMDgwMApTdWJqZWN0OiBbUEFU Q0ggMy83XSBSZXN0cnVjdHVyZQogJ3NlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHktLWhhbmRs ZS1raWxsLXRlcm1pbmFsJwoKVGhpcyBjaGFuZ2VzIHRoZSBmdW5jdGlvbiB0byBoYXZlIHRo ZSBzYW1lIHN0cnVjdHVyZSBhcwonc2VydmVyLXNhdmUtYnVmZmVycy1raWxsLXRlcm1pbmFs JywgYnV0IG90aGVyd2lzZSB3b3JrcyBleGFjdGx5IHRoZQpzYW1lIGFzIGJlZm9yZS4gIFRo aXMganVzdCB0YWtlcyB0aGUgbmVzdGVkICdpZicgc3RhdGVtZW50IGFuZCBicmluZ3MKaXQg dG8gdGhlIHRvcCBsZXZlbCBhcyAnY29uZCcgKG5vdGUgdGhhdCB0aGUgJ2NsaWVudCcgZnJh bWUgcGFyYW1ldGVyCmNhbiBvbmx5IGJlIGEgcHJvY2VzcyBvciB0aGUgc3ltYm9sICdub3dh aXQnIGhlcmUsIHNpbmNlIG90aGVyd2lzZQonc2VydmVyLXNhdmUtYnVmZmVycy1raWxsLXRl cm1pbmFsJyB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CisJCQkgICAgICAgIChub3QgKGVxIGZyYW1lIGYpKSkK KwkJICAgICAgIChzZXQtZnJhbWUtcGFyYW1ldGVyIGYgJ2NsaWVudCBuaWwpCisJCSAgICAg ICAobGV0ICgoc2VydmVyLXN0b3AtYXV0b21hdGljYWxseSBuaWwpKQorCQkgICAgICAgICAo ZGVsZXRlLWZyYW1lIGYpKSkpCisJICAgICAgICAgICAoaWYgKGNkZHIgKGZyYW1lLWxpc3Qp KQorCQkgICAgICAgKGxldCAoKHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkgbmlsKSkKKwkJ ICAgICAgICAgKGRlbGV0ZS1mcmFtZSBmcmFtZSkKKwkJICAgICAgICAgbmlsKQorCQkgICAg IHQpKQorCSAgICAgICAgIChsZXQgKChzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5IG5pbCkp CisJICAgICAgICAgICAoc2F2ZS1idWZmZXJzLWtpbGwtZW1hY3MpCisJICAgICAgICAgICAo ZGVsZXRlLWZyYW1lIGZyYW1lKSkpKSkpKSkKIAogKGRlZnVuIHNlcnZlci1zdG9wLWF1dG9t YXRpY2FsbHktLW1heWJlLWtpbGwtZW1hY3MgKCkKICAgIkhhbmRsZSBjbG9zaW5nIG9mIEVt YWNzIGRhZW1vbiB3aGVuIGBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5JyBpcyB1c2VkLiIK LS0gCjIuMjUuMQoK --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; name="0004-Remove-unnecessary-delete-frame-calls-after-save-buf.patch" Content-Disposition: attachment; filename*0="0004-Remove-unnecessary-delete-frame-calls-after-save-buf.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA2OTRhYWQ0MzJhZWU3M2FjZDIzMzVmNWVhNWQwZjQ3ZDBjODM3OWUyIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0Bn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Qot CSAgICAgICAgICAgKGRlbGV0ZS1mcmFtZSBmcmFtZSkpKSkKKwkgICAgICAgICAoc2F2ZS1i dWZmZXJzLWtpbGwtZW1hY3MpKSkKICAgICAgICAgICAgICgocHJvY2Vzc3AgcHJvYykKICAg ICAgICAgICAgICAoaWYgKHByb2duCiAJICAgICAgICAgICAoZG9saXN0IChmIChmcmFtZS1s aXN0KSkKQEAgLTE4MzUsOSArMTgzMyw3IEBAIHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkt LWhhbmRsZS1raWxsLXRlcm1pbmFsCiAJCSAgICAgICAgIChkZWxldGUtZnJhbWUgZnJhbWUp CiAJCSAgICAgICAgIG5pbCkKIAkJICAgICB0KSkKLQkgICAgICAgICAobGV0ICgoc2VydmVy LXN0b3AtYXV0b21hdGljYWxseSBuaWwpKQotCSAgICAgICAgICAgKHNhdmUtYnVmZmVycy1r aWxsLWVtYWNzKQotCSAgICAgICAgICAgKGRlbGV0ZS1mcmFtZSBmcmFtZSkpKSkpKSkpCisJ ICAgICAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVtYWNzKSkpKSkpKQogCiAoZGVmdW4gc2Vy dmVyLXN0b3AtYXV0b21hdGljYWxseS0tbWF5YmUta2lsbC1lbWFjcyAoKQogICAiSGFuZGxl IGNsb3Npbmcgb2YgRW1hY3MgZGFlbW9uIHdoZW4gYHNlcnZlci1zdG9wLWF1dG9tYXRpY2Fs bHknIGlzIHVzZWQuIgotLSAKMi4yNS4xCgo= --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; name="0005-This-is-the-commit-that-actually-fixes-bug-51993.patch" Content-Disposition: attachment; filename*0="0005-This-is-the-commit-that-actually-fixes-bug-51993.patch" Content-Transfer-Encoding: base64 RnJvbSAzNzMwYTBjNTVlZDQxNmVjMDA3Mzk3YmUzMTJjMzIyM2ViZTA3OGFkIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9yd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LXNhdmUtYnVmZmVycy1raWxs LXRlcm1pbmFsJy4KKyAgICAgICAgICAgICAgICAgKHByb2duCisgICAgICAgICAgICAgICAg ICAgKHNhdmUtc29tZS1idWZmZXJzKQorCSAgICAgICAgICAgKGRlbGV0ZS1mcmFtZSkpCisg ICAgICAgICAgICAgICAgIDs7IElmIHdlJ3JlIHRoZSBsYXN0IG5vbi1kYWVtb24gZnJhbWUg c3RhbmRpbmcsIGtpbGwKKyAgICAgICAgICAgICAgICAgOzsgRW1hY3MuCiAJICAgICAgICAg KHNhdmUtYnVmZmVycy1raWxsLWVtYWNzKSkpCiAgICAgICAgICAgICAoKHByb2Nlc3NwIHBy b2MpCi0gICAgICAgICAgICAgKGlmIChwcm9nbgotCSAgICAgICAgICAgKGRvbGlzdCAoZiAo ZnJhbWUtbGlzdCkpCi0JCSAgICAgKHdoZW4gKGFuZCAoZXEgKGZyYW1lLXBhcmFtZXRlciBm cmFtZSAnY2xpZW50KQotCQkJICAgICAgICAgICAgKGZyYW1lLXBhcmFtZXRlciBmICdjbGll bnQpKQotCQkJICAgICAgICAobm90IChlcSBmcmFtZSBmKSkpCi0JCSAgICAgICAoc2V0LWZy YW1lLXBhcmFtZXRlciBmICdjbGllbnQgbmlsKQotCQkgICAgICAgKGxldCAoKHNlcnZlci1z dG9wLWF1dG9tYXRpY2FsbHkgbmlsKSkKLQkJICAgICAgICAgKGRlbGV0ZS1mcmFtZSBmKSkp KQotCSAgICAgICAgICAgKGlmIChjZGRyIChmcmFtZS1saXN0KSkKLQkJICAgICAgIChsZXQg KChzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5IG5pbCkpCi0JCSAgICAgICAgIChkZWxldGUt ZnJhbWUgZnJhbWUpCi0JCSAgICAgICAgIG5pbCkKLQkJICAgICB0KSkKLQkgICAgICAgICAo c2F2ZS1idWZmZXJzLWtpbGwtZW1hY3MpKSkpKSkpCisgICAgICAgICAgICAgKGlmIDs7IEtl ZXAgdGhlIHNlcnZlciBhbGl2ZSBpZi4uLgorICAgICAgICAgICAgICAgICAob3IKKyAgICAg ICAgICAgICAgICAgIDs7IGEpIHRoZXJlIGFyZSBhbnkgb3RoZXIgY2xpZW50cywgb3IuLi4K KyAgICAgICAgICAgICAgICAgIChsZW5ndGg+IHNlcnZlci1jbGllbnRzIDEpCisgICAgICAg ICAgICAgICAgICA7OyBiKSB0aGVyZSBhcmUgYW55IGZyYW1lcyBub3Qgb3duZWQgYnkgdGhp cyBjbGllbnQuCisgICAgICAgICAgICAgICAgICAoc2VxLXNvbWUKKyAgICAgICAgICAgICAg ICAgICAobGFtYmRhIChmcmFtZSkKKyAgICAgICAgICAgICAgICAgICAgICh3aGVuLWxldCAo KHAgKGZyYW1lLXBhcmFtZXRlciBmcmFtZSAnY2xpZW50KSkpCisgICAgICAgICAgICAgICAg ICAgICAgIChub3QgKGVxIHByb2MgcCkpKSkKKyAgICAgICAgICAgICAgICAgICAoZnJhbWUt bGlzdCkpKQorICAgICAgICAgICAgICAgICAobGV0ICgoYnVmZmVycyAocHJvY2Vzcy1nZXQg cHJvYyAnYnVmZmVycykpKQorICAgICAgICAgICAgICAgICAgIChzYXZlLXNvbWUtYnVmZmVy cworICAgICAgICAgICAgICAgICAgICBuaWwgKGlmIGJ1ZmZlcnMKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICA7OyBPbmx5IGZpbGVzIGZyb20gZW1hY3NjbGllbnQgZmlsZSBsaXN0 LgorCQkgICAgICAgICAgICAobGFtYmRhICgpIChtZW1xIChjdXJyZW50LWJ1ZmZlcikgYnVm ZmVycykpKSkKKyAgICAgICAgICAgICAgICAgICAoc2VydmVyLWRlbGV0ZS1jbGllbnQpKQor ICAgICAgICAgICAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVtYWNzKSkpKSkpKQogCiAoZGVm dW4gc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0tbWF5YmUta2lsbC1lbWFjcyAoKQogICAi SGFuZGxlIGNsb3Npbmcgb2YgRW1hY3MgZGFlbW9uIHdoZW4gYHNlcnZlci1zdG9wLWF1dG9t YXRpY2FsbHknIGlzIHVzZWQuIgotLSAKMi4yNS4xCgo= --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; name="0006-Merge-kill-terminal-implementations.patch" Content-Disposition: attachment; filename="0006-Merge-kill-terminal-implementations.patch" Content-Transfer-Encoding: base64 RnJvbSBmZTZmZjYyZGUzZjE4YzJkOGY5YzBhMDAzMmZmZjM5NjE1MzgwMjk5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFRodSwgMSBEZWMgMjAyMiAxMjoxOTo0NCAtMDgwMApTdWJqZWN0OiBbUEFU Q0ggNi83XSBNZXJnZSBraWxsLXRlcm1pbmFsIGltcGxlbWVudGF0aW9ucwoKTm93IHRoYXQg J3NlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHktLWhhbmRsZS1raWxsLXRlcm1pbmFsJyBhbmQK J3NlcnZlci1zYXZlLWJ1ZmZlcnMta2lsbC10ZXJtaW5hbCcgYXJlIGFsbW9zdCB0aGUgc2Ft ZSwgbWVyZ2UgdGhlbQppbnRvIGEgc2luZ2xlIGZ1bmN0aW9uLgoKKiBsaXNwL3NlcnZlci5l bCAoc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0taGFuZGxlLWtpbGwtdGVybWluYWwpOgpN ZXJnZSB0aGlzLi4uCihzZXJ2ZXItc2F2ZS1idWZmZXJzLWtpbGwtdGVybWluYWwpOiAuLi4g aW50byB0aGlzLgotLS0KIGxpc3Avc2VydmVyLmVsIHwgOTIgKysrKysrKysrKysrKysrKysr Ky0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCAzNSBp bnNlcnRpb25zKCspLCA1NyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgY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g ICAgICA7OyBXaGVuIGBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5JyBpcyBzZXQsIGRvbid0 IGNvdW50CisgICAgICAgICAgICAgICA7OyB0aGUgZGFlbW9uIGZyYW1lLgorCSAgICAgICAo cHJvZ24gKHNhdmUtc29tZS1idWZmZXJzIGFyZykKKwkJICAgICAgKGRlbGV0ZS1mcmFtZSkp CisJICAgICA7OyBJZiB3ZSdyZSB0aGUgbGFzdCBmcmFtZSBzdGFuZGluZywga2lsbCBFbWFj cy4KKwkgICAgIChzYXZlLWJ1ZmZlcnMta2lsbC1lbWFjcyBhcmcpKSkKKwkgICgocHJvY2Vz c3AgcHJvYykKKyAgICAgICAgICAgKGlmIChvciAobm90IHNlcnZlci1zdG9wLWF1dG9tYXRp Y2FsbHkpCisgICAgICAgICAgICAgICAgICAgKGxlbmd0aD4gc2VydmVyLWNsaWVudHMgMSkK KyAgICAgICAgICAgICAgICAgICAoc2VxLXNvbWUKKyAgICAgICAgICAgICAgICAgICAgKGxh bWJkYSAoZnJhbWUpCisgICAgICAgICAgICAgICAgICAgICAgKHdoZW4tbGV0ICgocCAoZnJh bWUtcGFyYW1ldGVyIGZyYW1lICdjbGllbnQpKSkKKyAgICAgICAgICAgICAgICAgICAgICAg IChub3QgKGVxIHByb2MgcCkpKSkKKyAgICAgICAgICAgICAgICAgICAgKGZyYW1lLWxpc3Qp KSkKKwkgICAgICAgKGxldCAoKGJ1ZmZlcnMgKHByb2Nlc3MtZ2V0IHByb2MgJ2J1ZmZlcnMp KSkKKwkgICAgICAgICAoc2F2ZS1zb21lLWJ1ZmZlcnMKKwkgICAgICAgICAgYXJnIChpZiBi dWZmZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IE9ubHkgZmlsZXMgZnJvbSBl bWFjc2NsaWVudCBmaWxlIGxpc3QuCisJCSAgICAgICAgICAobGFtYmRhICgpIChtZW1xIChj dXJyZW50LWJ1ZmZlcikgYnVmZmVycykpCisgICAgICAgICAgICAgICAgICAgICAgICA7OyBO byBlbWFjc2NsaWVudCBmaWxlIGxpc3Q6IGRvbid0IG92ZXJyaWRlCisgICAgICAgICAgICAg ICAgICAgICAgICA7OyBgc2F2ZS1zb21lLWJ1ZmZlcnMtZGVmYXVsdC1wcmVkaWNhdGUnICh1 bmxlc3MKKyAgICAgICAgICAgICAgICAgICAgICAgIDs7IEFSRyBpcyBub24tbmlsKSwgc2lu Y2Ugd2UncmUgbm90IGtpbGxpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgIDs7IEVtYWNz ICh1bmxpa2UgYHNhdmUtYnVmZmVycy1raWxsLWVtYWNzJykuCisJCSAgICAgICAgKGFuZCBh cmcgdCkpKQorCSAgICAgICAgIChzZXJ2ZXItZGVsZXRlLWNsaWVudCBwcm9jKSkKKyAgICAg ICAgICAgICA7OyBJZiBgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseScgaXMgc2V0LCB0aGVy ZSBhcmUgbm8KKyAgICAgICAgICAgICA7OyBvdGhlciBjbGllbnQgcHJvY2Vzc2VzLCBhbmQg bm8gb3RoZXIgY2xpZW50IGZyYW1lcworICAgICAgICAgICAgIDs7IChlLmcuIGBub3dhaXQn IGZyYW1lcyksIGtpbGwgRW1hY3MuCisgICAgICAgICAgICAgKHNhdmUtYnVmZmVycy1raWxs LWVtYWNzIGFyZykpKQorCSAgKHQgKGVycm9yICJJbnZhbGlkIGNsaWVudCBmcmFtZSIpKSkp KQogCiAoZGVmdW4gc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0taGFuZGxlLWRlbGV0ZS1m cmFtZSAoZnJhbWUpCiAgICJIYW5kbGUgZGVsZXRpb24gb2YgRlJBTUUgd2hlbiBgc2VydmVy LXN0b3AtYXV0b21hdGljYWxseScgaXMgdXNlZC4iCkBAIC0xODEyLDQwICsxODI0LDYgQEAg c2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0taGFuZGxlLWRlbGV0ZS1mcmFtZQogCSAgKHNh dmUtYnVmZmVyc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2ZSBpZi4uLgotICAgICAgICAgICAg ICAgICAob3IKLSAgICAgICAgICAgICAgICAgIDs7IGEpIHRoZXJlIGFyZSBhbnkgb3RoZXIg Y2xpZW50cywgb3IuLi4KLSAgICAgICAgICAgICAgICAgIChsZW5ndGg+IHNlcnZlci1jbGll bnRzIDEpCi0gICAgICAgICAgICAgICAgICA7OyBiKSB0aGVyZSBhcmUgYW55IGZyYW1lcyBu b3Qgb3duZWQgYnkgdGhpcyBjbGllbnQuCi0gICAgICAgICAgICAgICAgICAoc2VxLXNvbWUK LSAgICAgICAgICAgICAgICAgICAobGFtYmRhIChmcmFtZSkKLSAgICAgICAgICAgICAgICAg ICAgICh3aGVuLWxldCAoKHAgKGZyYW1lLXBhcmFtZXRlciBmcmFtZSAnY2xpZW50KSkpCi0g ICAgICAgICAgICAgICAgICAgICAgIChub3QgKGVxIHByb2MgcCkpKSkKLSAgICAgICAgICAg ICAgICAgICAoZnJhbWUtbGlzdCkpKQotICAgICAgICAgICAgICAgICAobGV0ICgoYnVmZmVy cyAocHJvY2Vzcy1nZXQgcHJvYyAnYnVmZmVycykpKQotICAgICAgICAgICAgICAgICAgIChz YXZlLXNvbWUtYnVmZmVycwotICAgICAgICAgICAgICAgICAgICBuaWwgKGlmIGJ1ZmZlcnMK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBPbmx5IGZpbGVzIGZyb20gZW1hY3Nj bGllbnQgZmlsZSBsaXN0LgotCQkgICAgICAgICAgICAobGFtYmRhICgpIChtZW1xIChjdXJy ZW50LWJ1ZmZlcikgYnVmZmVycykpKSkKLSAgICAgICAgICAgICAgICAgICAoc2VydmVyLWRl bGV0ZS1jbGllbnQpKQotICAgICAgICAgICAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVtYWNz KSkpKSkpKQotCiAoZGVmdW4gc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0tbWF5YmUta2ls bC1lbWFjcyAoKQogICAiSGFuZGxlIGNsb3Npbmcgb2YgRW1hY3MgZGFlbW9uIHdoZW4gYHNl cnZlci1zdG9wLWF1dG9tYXRpY2FsbHknIGlzIHVzZWQuIgogICAodW5sZXNzIChjZHIgKGZy YW1lLWxpc3QpKQotLSAKMi4yNS4xCgo= --------------kP04AvxyTSEJW1KPGKYjpSB1 Content-Type: text/plain; charset=UTF-8; name="0007-Simplify-server-stop-automatically-handle-delete-fra.patch" Content-Disposition: attachment; filename*0="0007-Simplify-server-stop-automatically-handle-delete-fra.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBhNzliNGYzNGZhZjJjMGJkMzBmOGQ2NmY4N2U0ZDg0ODMyNDc3MzcxIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFRodSwgMSBEZWMgMjAyMiAxMjoyMzoxNyAtMDgwMApTdWJqZWN0OiBbUEFU Q0ggNy83XSBTaW1wbGlmeSAnc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0taGFuZGxlLWRl bGV0ZS1mcmFtZScKCiogbGlzcC9zZXJ2ZXIuZWwgKHNlcnZlci1zdG9wLWF1dG9tYXRpY2Fs bHktLWhhbmRsZS1kZWxldGUtZnJhbWUpOgpDb21iaW5lIHRoZSAnd2hlbicgYW5kICdpZicg aW50byBhIHNpbmdsZSBjb25kaXRpb25hbC4KLS0tCiBsaXNwL3NlcnZlci5lbCB8IDEwICsr KysrLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA1IGluc2VydGlvbnMoKyksIDUgZGVsZXRpb25z KC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9zZXJ2ZXIuZWwgYi9saXNwL3NlcnZlci5lbAppbmRl eCA2ZWVhYTkzMmE3Li5lODhjZmZhOGZiIDEwMDY0NAotLS0gYS9saXNwL3NlcnZlci5lbAor KysgYi9saXNwL3NlcnZlci5lbApAQCAtMTgxOCwxMSArMTgxOCwxMSBAQCBzZXJ2ZXItc2F2 ZS1idWZmZXJzLWtpbGwtdGVybWluYWwKIAogKGRlZnVuIHNlcnZlci1zdG9wLWF1dG9tYXRp Y2FsbHktLWhhbmRsZS1kZWxldGUtZnJhbWUgKGZyYW1lKQogICAiSGFuZGxlIGRlbGV0aW9u IG9mIEZSQU1FIHdoZW4gYHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHknIGlzIHVzZWQuIgot ICAod2hlbiBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5Ci0gICAgKGlmIChudWxsIChjZGRy IChmcmFtZS1saXN0KSkpCi0JKGxldCAoKHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkgbmls KSkKLQkgIChzYXZlLWJ1ZmZlcnMta2lsbC1lbWFjcykKLQkgIChkZWxldGUtZnJhbWUgZnJh bWUpKSkpKQorICAod2hlbiAoYW5kIHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkKKyAgICAg ICAgICAgICAobnVsbCAoY2RkciAoZnJhbWUtbGlzdCkpKSkKKyAgICAobGV0ICgoc2VydmVy LXN0b3AtYXV0b21hdGljYWxseSBuaWwpKQorICAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVt YWNzKQorICAgICAgKGRlbGV0ZS1mcmFtZSBmcmFtZSkpKSkKIAogKGRlZnVuIHNlcnZlci1z dG9wLWF1dG9tYXRpY2FsbHktLW1heWJlLWtpbGwtZW1hY3MgKCkKICAgIkhhbmRsZSBjbG9z aW5nIG9mIEVtYWNzIGRhZW1vbiB3aGVuIGBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5JyBp cyB1c2VkLiIKLS0gCjIuMjUuMQoK --------------kP04AvxyTSEJW1KPGKYjpSB1-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 09:10:44 2022 Received: (at 51993) by debbugs.gnu.org; 2 Dec 2022 14:10:44 +0000 Received: from localhost ([127.0.0.1]:46953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p16kV-0005tx-HY for submit@debbugs.gnu.org; Fri, 02 Dec 2022 09:10:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p16kT-0005tf-LI for 51993@debbugs.gnu.org; Fri, 02 Dec 2022 09:10:42 -0500 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 1p16kN-0003Wi-Mp; Fri, 02 Dec 2022 09:10:35 -0500 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=LNao1rSL21YUfyFVQUPJXXM9caAbVxQcM8nhh3N0OqM=; b=aOD79Cqj4aNY pP1yGfiwoZU33ihJnWl4H3vawqgzqRk4VmeSjHvzX8RfzVqqavMlM8ariyUe2nQTdTte0kf6+yIOS liiUBWdK+xrPTKieS8iPAnqyVyVI2a8GherJpXakRATBDBgTdUcHH8Pb2QJ+zbSvaCkt/ICASdihN lL1uGj9MQgc1G4YetWX+jP0E+ERXb/0qyb9oQ0qh+eBXG6Lus/VCzflhFqfNsfK8EqnO8HO2/yCCN X+wtgE7gVIFb1issx53Jkjrt8s8gKYeXBaLLo8324nKx3NvQd0dv9OHOLaPQF2UUxfDfQpux1vDjF gEN1k4ZM+FL/7FEzK7qTDw==; 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 1p16kN-0005gU-5F; Fri, 02 Dec 2022 09:10:35 -0500 Date: Fri, 02 Dec 2022 16:10:10 +0200 Message-Id: <83edthgam5.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: <8e62e7aa-7050-6b35-9128-79517efa4557@gmail.com> (message from Jim Porter on Thu, 1 Dec 2022 17:09:24 -0800) Subject: Re: bug#51993: 29.0.50; [PATCH for 29.1] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> <8e62e7aa-7050-6b35-9128-79517efa4557@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Please in the future avoid changing the Subject when discussing bugs: it makes it harder for me and others to follow the discussion by grouping messages by Subject.] > Date: Thu, 1 Dec 2022 17:09:24 -0800 > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > From: Jim Porter > > > We want this on the release branch, right? Then please make it the minimal > > change which fixes the immediate cause of the bug, and does nothing else: no > > refactoring, no reshuffling of the code or making it nicer or less > > complicated -- all that just makes the risk of new bugs higher and the job > > of reviewing the patch harder. > > Thanks for taking a look. I believe we'd want this on the release > branch. Here's the absolute minimum I could manage, although it doesn't > quite fix everything that my previous patch does. Thanks. Surprisingly, the previous version was easier to review and agree to in some of its parts, because it kept more of the original code, and only changed the conditions when save-some-buffers or save-buffers-kill-emacs were called. This version of the patch completely rewrites the affected code. Was that really necessary? > In particular, when > server-stop-automatically is set to 'kill-terminal' (or 'delete-frame'): > > * If you type 'C-x C-c' ('save-buffers-kill-terminal') in a nowait > client frame, and there are still other (non-daemon) frames, nothing > happens. You'd have to use 'C-x 5 0' ('delete-frame') instead. Fixing > this would basically mean doing 90% of my original patch, so it's > probably too risky. > > * If you type 'C-u C-x C-c', it doesn't silently save all the relevant > buffers. That's because 'server-save-buffers-kill-terminal' doesn't > forward the prefix arg to > 'server-stop-automatically--handle-delete-frame'. That's a separate (but > closely related) bug, so I didn't fix that either. Please tell more about why these two situations cannot be handled by similarly simple changes. What made the original patch risky from my POV is that it rewrote too much of the original code. Would it be possible to retain as much as possible of the original code, and just change the conditions for calling save-some-buffers etc., and/or add calls to it where it previously wasn't called for some reason? Please understand where I stand: use of emacsclient is very popular and very widespread, so I'd like to avoid adding regressions to it as result of enhancements we make. If I conclude that the new features installed as part of Emacs 29 development are too complicated and/or include semi-buggy aspects, I'd rather revert those new features than risk regressions in emacsclient and in the server behavior. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 09:32:03 2022 Received: (at 51993) by debbugs.gnu.org; 2 Dec 2022 14:32:03 +0000 Received: from localhost ([127.0.0.1]:47058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1759-00066B-2x for submit@debbugs.gnu.org; Fri, 02 Dec 2022 09:32:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1754-00065x-17 for 51993@debbugs.gnu.org; Fri, 02 Dec 2022 09:32:00 -0500 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 1p174y-0003tW-07; Fri, 02 Dec 2022 09:31:52 -0500 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=TPSWbr7toN61ovdCBSgvHTv92W2kyWLhSOgIANh1Fhc=; b=gWfXDSiX1WQ3 pB9kmBE3ts7ATdpnZ5TXSZ9BlftvNqZX2pdmdhW5PnM/hSZHiEvjUrFn/i8lk+UnEujhUZSWg/dlI JzAxUm/YxtmXWUHCQUSmlWmkGz+VKyuIPD2iv0u1Y3gPZu4TZWaNqxmO3cP2TBw0duvmoTl9YMH6O Qol6NBu2ix9/zoCQcgbfb53VhELg2laVRZbyvjb9tGetGqWNgFa+cBlZ/22jys6DURRkANaO8s2yx r33PSbjsBjBH79CX2cSiBgiIsObFyMWFGOvzplJrD2hp3BWtN9J6NicK8Y8WjYRLSkZXYK8ZAmw2Q IKWVSt/X70UAqpR6nigx8g==; 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 1p174x-0000aO-Ah; Fri, 02 Dec 2022 09:31:51 -0500 Date: Fri, 02 Dec 2022 16:31:27 +0200 Message-Id: <83bkolg9mo.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: <30673991-caf6-afeb-ec05-d70d6fc45f48@gmail.com> (message from Jim Porter on Thu, 1 Dec 2022 17:42:18 -0800) Subject: Re: bug#51993: 29.0.50; [PATCH explanation] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> <30673991-caf6-afeb-ec05-d70d6fc45f48@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 1 Dec 2022 17:42:18 -0800 > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > From: Jim Porter > > Attached is a patch series that explains in more detail how I arrived at > the previous version of my patch. This is basically a reconstruction of > the steps I took when writing it originally. I'll describe my overall > plan and then address the specific comments you had after that. (This > might be overly-verbose, but I wanted to put as much detail in as I > could in the hopes of addressing all your concerns.) Thanks, but unfortunately this methodology doesn't make it easier for me to review the changes. Personally, I'd prefer to have a single place with the logic of what happens when the user closes the last client frame or the last frame on a specific terminal. But I'd like to make progress in this anyway, at least on master. So I'm okay with having your code installed on master as it is, if that is what you prefer. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 16:33:50 2022 Received: (at 51993) by debbugs.gnu.org; 2 Dec 2022 21:33:50 +0000 Received: from localhost ([127.0.0.1]:49013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1DfJ-0001Zj-W6 for submit@debbugs.gnu.org; Fri, 02 Dec 2022 16:33:50 -0500 Received: from mail-pj1-f45.google.com ([209.85.216.45]:56141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1DfH-0001Zd-QR for 51993@debbugs.gnu.org; Fri, 02 Dec 2022 16:33:48 -0500 Received: by mail-pj1-f45.google.com with SMTP id k5so6074035pjo.5 for <51993@debbugs.gnu.org>; Fri, 02 Dec 2022 13:33:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=Rk0cj9ePobc9FCMnZymPb1IZ6Kzx8pnp/fBT4hKWBLY=; b=iyYTmCDfruj5uJwOmECb8ARCiYuh/2IhrktnNUyRIJJDOhi6YbsifYiwiTFSP1zA2W 7FlmFiMs+bYBM3ZM/bPkWs1Ju4pSbWVb1l/wrW+7q18aIe8n1IsrNKqC03MWZhdFKcd6 q/xsJi1w4VHBxHTO2PzXCrj2lmyfNwQ2SRHiZPQ58JyxXSlRxp0ngonHp/tsd1xPOufm DHUXosX6ZZrMX5SrTq2BURNHpVWCS3+rRPX/li2Lb4hqqZl8528T24U6NoK67ltvXy98 Gm2TpGmksESr7izmGISTTilCRtICcaplu1mqi0GkHQTiJ593HCdqdsDeehUGsbHDAasL AFgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Rk0cj9ePobc9FCMnZymPb1IZ6Kzx8pnp/fBT4hKWBLY=; b=d5YfVa73xp73+lhswqDu99NOotErLUj5WXcQFAEqEJAWrOuQjOny2GgQ7OJeOZyMrI SeoKiNbFsp/P5Svc6VnYL67sVKq6Klnz4l1Ez4YpJTQo3up2QLGhPkVpO1XL4S5vatdr qELD4vB/gwolfW5skrBU48EwNWhh84BMS6os1mb+w5Fltu15+3mN5IKgkNVbB+qJxio/ +xjC0vEnLb0+Y7iYIvEPeifS6SzMkA1CBIK9T5lqsAf6QKse9yuiGa4quOoJwi483zg8 nIUdNaU+b6jUYdPGIuTALKGgRQTEx7YpMu/EHkoE2hq88UHFBMwHIuVOEXoM7tbnLmju BmHw== X-Gm-Message-State: ANoB5pltt2WthlgJLQDsz5ihkPxjYKDPL3UQsncUaHcIFa5e/x7um3H5 2XRYpIqKC+5OQAsWTmawg9k= X-Google-Smtp-Source: AA0mqf4lgQaLpZtfQphwkem7vwicxJqazJsOxJ17bh6+edO9upqTbQkd2HNfdAoQ+MJB7bya+Qj81g== X-Received: by 2002:a17:90b:48c8:b0:20b:16bc:8493 with SMTP id li8-20020a17090b48c800b0020b16bc8493mr8689655pjb.210.1670016821886; Fri, 02 Dec 2022 13:33:41 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id t15-20020a63f34f000000b0046fefb18a09sm4466041pgj.91.2022.12.02.13.33.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 Dec 2022 13:33:40 -0800 (PST) Content-Type: multipart/mixed; boundary="------------SbPo8vFz6U0x2FD0julmjuXQ" Message-ID: <9b079bad-8d51-02b9-baad-151c57cfed3f@gmail.com> Date: Fri, 2 Dec 2022 13:33:39 -0800 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH for 29.1] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> <8e62e7aa-7050-6b35-9128-79517efa4557@gmail.com> <83edthgam5.fsf@gnu.org> From: Jim Porter In-Reply-To: <83edthgam5.fsf@gnu.org> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------SbPo8vFz6U0x2FD0julmjuXQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/2/2022 6:10 AM, Eli Zaretskii wrote: > [Please in the future avoid changing the Subject when discussing bugs: it > makes it harder for me and others to follow the discussion by grouping > messages by Subject.] Sorry about that. I thought it would be easier to see that I'd split the topic into two separate tracks. I'll keep that in mind for the future though. > Thanks. Surprisingly, the previous version was easier to review and agree > to in some of its parts, because it kept more of the original code, and only > changed the conditions when save-some-buffers or save-buffers-kill-emacs > were called. I think I must have misinterpreted where your main concerns were, and went down the wrong avenue as a result. I think your other comments here (and re-reading your previous message) have helped me get a better idea of your concerns, so I'll try to address your earlier message better. On 12/1/2022 9:29 AM, Eli Zaretskii wrote: >> (defun server-stop-automatically--handle-delete-frame (frame) >> "Handle deletion of FRAME when `server-stop-automatically' is used." [snip -- long diff removed] > > And here you completely rewrote a function. Thinking about this some more, that change wasn't strictly necessary for 29.1, since it should really just be dead code, and won't hurt anything. I've split this part out into a separate commit that we could apply to only the master branch. That simplifies the first commit (for 29.1) a fair bit. >> @@ -1801,31 +1809,20 @@ server-save-buffers-kill-terminal >> ;; ARG is non-nil), since we're not killing >> ;; Emacs (unlike `save-buffers-kill-emacs'). >> (and arg t))) >> - (server-delete-client proc))) >> - (t (error "Invalid client frame")))))) >> + (server-delete-client proc)) >> + ;; If `server-stop-automatically' is set, there are no >> + ;; other client processes, and no other client frames >> + ;; (e.g. `nowait' frames), kill Emacs. >> + (save-buffers-kill-emacs arg))) >> + (t (error "Invalid client frame"))))) > > But this one is problematic: it adds save-buffers-kill-emacs which wasn't in > the original code, and I don't understand why. The bug wasn't about this, > was it? I believe this change is the most important part of the patch, so I'll try to explain why I added this. The 'server-stop-automatically' feature causes the Emacs daemon to be killed when certain conditions are met. For the 'kill-terminal' case[1], that means that, "when the last client frame is being closed with C-x C-c, you are asked whether [various questions], and if so, the server is stopped." (From the manual section on this.) The "last client frame" check is the conditional just before this hunk (you mentioned that this part was fine, so I didn't include it in this message). The latter part of the sentence in the manual is just a description of 'save-buffers-kill-emacs'. So I've tried to take the text of the manual and turn it into code. Another way of looking at it: the new 'save-buffers-kill-emacs' call above is really the result of me moving the handling for this condition from 'server-stop-automatically--handle-delete-frame' into 'server-save-buffers-kill-terminal'. Previously, that function was responsible for calling 'save-buffers-kill-emacs' at the right time. Doing it this way lets me avoid calling 'SSA--handle-delete-frame' so that we get the benefit of using the longstanding implementation of 'server-save-buffers-kill-terminal', just with the minimum of necessary enhancements to make this stop-automatically setting behave as documented. [1] This also applies to 'delete-frame', but that setting does more beyond this. --------------SbPo8vFz6U0x2FD0julmjuXQ Content-Type: text/plain; charset=UTF-8; name="29.1--0001-Make-killing-a-non-last-client-work-the-same-no-matt.patch" Content-Disposition: attachment; filename*0="29.1--0001-Make-killing-a-non-last-client-work-the-same-no-m"; filename*1="att.patch" Content-Transfer-Encoding: base64 RnJvbSA2MDgxZTE1NmJhMzRmOWY3ZDhiMjEyYmU4MjAxNjM5ZjJmNjg5MjE5IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IEZyaSwgMiBEZWMgMjAyMiAxMjoxNDo1MCAtMDgwMApTdWJqZWN0OiBbUEFU Q0ggMS8yXSBNYWtlIGtpbGxpbmcgYSBub24tbGFzdCBjbGllbnQgd29yayB0aGUgc2FtZSBu byBtYXR0ZXIKIHRoZSBhdXRvLXN0b3Agc2V0dGluZwoKUHJldmlvdXNseSwgaWYgJ3NlcnZl ci1zdG9wLWF1dG9tYXRpY2FsbHknIHdhcyBjb25maWd1cmVkIGZvcgona2lsbC10ZXJtaW5h bCcgb3IgJ2RlbGV0ZS1mcmFtZScsIGtpbGxpbmcgYSBjbGllbnQgdmlhCidzYXZ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dmUtYnVmZmVycy1raWxsLWVtYWNzIGFyZykpKQorCSAgKChwcm9jZXNzcCBwcm9j KQorICAgICAgICAgICAoaWYgKG9yIChub3Qgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseSkK KyAgICAgICAgICAgICAgICAgICAobGVuZ3RoPiBzZXJ2ZXItY2xpZW50cyAxKQorICAgICAg ICAgICAgICAgICAgIChzZXEtc29tZQorICAgICAgICAgICAgICAgICAgICAobGFtYmRhIChm cmFtZSkKKyAgICAgICAgICAgICAgICAgICAgICAod2hlbi1sZXQgKChwIChmcmFtZS1wYXJh bWV0ZXIgZnJhbWUgJ2NsaWVudCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAo ZXEgcHJvYyBwKSkpKQorICAgICAgICAgICAgICAgICAgICAoZnJhbWUtbGlzdCkpKQorICAg ICAgICAgICAgICAgOzsgSWYgYHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHknIGlzIG5vdCBl bmFibGVkLCB0aGVyZQorICAgICAgICAgICAgICAgOzsgYXJlIGFueSBvdGhlciBjbGllbnRz LCBvciB0aGVyZSBhcmUgZnJhbWVzIG5vdCBvd25lZAorICAgICAgICAgICAgICAgOzsgYnkg dGhlIGN1cnJlbnQgY2xpZW50IChlLmcuIGBub3dhaXQnIGZyYW1lcyksIHRoZW4KKyAgICAg ICAgICAgICAgIDs7IHdlIGp1c3Qgd2FudCB0byBkZWxldGUgdGhpcyBjbGllbnQuCisJICAg ICAgIChsZXQgKChidWZmZXJzIChwcm9jZXNzLWdldCBwcm9jICdidWZmZXJzKSkpCisJICAg ICAgICAgKHNhdmUtc29tZS1idWZmZXJzCisJICAgICAgICAgIGFyZyAoaWYgYnVmZmVycwor ICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBPbmx5IGZpbGVzIGZyb20gZW1hY3NjbGll bnQgZmlsZSBsaXN0LgorCQkgICAgICAgICAgKGxhbWJkYSAoKSAobWVtcSAoY3VycmVudC1i dWZmZXIpIGJ1ZmZlcnMpKQorICAgICAgICAgICAgICAgICAgICAgICAgOzsgTm8gZW1hY3Nj bGllbnQgZmlsZSBsaXN0OiBkb24ndCBvdmVycmlkZQorICAgICAgICAgICAgICAgICAgICAg ICAgOzsgYHNhdmUtc29tZS1idWZmZXJzLWRlZmF1bHQtcHJlZGljYXRlJyAodW5sZXNzCisg ICAgICAgICAgICAgICAgICAgICAgICA7OyBBUkcgaXMgbm9uLW5pbCksIHNpbmNlIHdlJ3Jl IG5vdCBraWxsaW5nCisgICAgICAgICAgICAgICAgICAgICAgICA7OyBFbWFjcyAodW5saWtl IGBzYXZlLWJ1ZmZlcnMta2lsbC1lbWFjcycpLgorCQkgICAgICAgIChhbmQgYXJnIHQpKSkK KwkgICAgICAgICAoc2VydmVyLWRlbGV0ZS1jbGllbnQgcHJvYykpCisgICAgICAgICAgICAg OzsgT3RoZXJ3aXNlLCB3ZSB3YW50IHRvIGtpbGwgRW1hY3MuCisgICAgICAgICAgICAgKHNh dmUtYnVmZmVycy1raWxsLWVtYWNzIGFyZykpKQorCSAgKHQgKGVycm9yICJJbnZhbGlkIGNs aWVudCBmcmFtZSIpKSkpKQogCiAoZGVmdW4gc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0t aGFuZGxlLWRlbGV0ZS1mcmFtZSAoZnJhbWUpCiAgICJIYW5kbGUgZGVsZXRpb24gb2YgRlJB TUUgd2hlbiBgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseScgaXMgdXNlZC4iCi0tIAoyLjI1 LjEKCg== --------------SbPo8vFz6U0x2FD0julmjuXQ Content-Type: text/plain; charset=UTF-8; name="master--0002-Remove-dead-code-from-server-stop-automatically-hand.patch" Content-Disposition: attachment; filename*0="master--0002-Remove-dead-code-from-server-stop-automatically"; filename*1="-hand.patch" Content-Transfer-Encoding: base64 RnJvbSBhMTRiMDQyOTgyZGM1OTc2NzQ5NTkwNWE5ZDQ1ZTA1NDIxMjRjMWU2IE1vbiBTZXAg MTcgMDA6MDA6MDAgMj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bC1lbWFjcykKLQkgIChkZWxldGUtZnJhbWUgZnJh bWUpKSkpKQorICAod2hlbiAoYW5kIHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkKKyAgICAg ICAgICAgICAobnVsbCAoY2RkciAoZnJhbWUtbGlzdCkpKSkKKyAgICAobGV0ICgoc2VydmVy LXN0b3AtYXV0b21hdGljYWxseSBuaWwpKQorICAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVt YWNzKSkpKQogCiAoZGVmdW4gc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0tbWF5YmUta2ls bC1lbWFjcyAoKQogICAiSGFuZGxlIGNsb3Npbmcgb2YgRW1hY3MgZGFlbW9uIHdoZW4gYHNl cnZlci1zdG9wLWF1dG9tYXRpY2FsbHknIGlzIHVzZWQuIgotLSAKMi4yNS4xCgo= --------------SbPo8vFz6U0x2FD0julmjuXQ-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 04 12:57:11 2022 Received: (at 51993) by debbugs.gnu.org; 4 Dec 2022 17:57:11 +0000 Received: from localhost ([127.0.0.1]:58955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1tEk-00077f-TQ for submit@debbugs.gnu.org; Sun, 04 Dec 2022 12:57:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1tEj-00077Z-UE for 51993@debbugs.gnu.org; Sun, 04 Dec 2022 12:57:10 -0500 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 1p1tEe-0006HL-IA; Sun, 04 Dec 2022 12:57:04 -0500 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=s98NJkb+7iq1YUeYpfILoQiawAe6lvP83g1/fqmrDV8=; b=IHhnoFjvG+8R 2Jf0ciuMeeJf44lHfMFx2aT2xqmdPD/gNTHhzMnJ/75f0TjdpRGEG+tt/kUqPa/Bsgs3Klb+WFW9F xIi6g9rZQ3bxNWIDkaPMxnSlB27IueQzi78x9SckkIcd6ufGQ9croCamjhzksNX6DOcc8loDGhbf/ vOX6XG8pvv4JJ7W8oZtDVOahuKJUW7CWBjOxxuEPJ8IcWT8jG6sCHXOS6KgFeoHXZYJ8WsPJcyeC5 p168KEowdAh71Of8PXlevqz6PcQLM3CmL9n7pyzj9WErgewxjk5DRWtd3pG3KSqomm355c2LPFLA/ 2obkFF3FL5GpzfADV+BWlA==; 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 1p1tEd-0007kH-UA; Sun, 04 Dec 2022 12:57:04 -0500 Date: Sun, 04 Dec 2022 19:56:46 +0200 Message-Id: <83fsdv9hnl.fsf@gnu.org> From: Eli Zaretskii To: Jim Porter In-Reply-To: <9b079bad-8d51-02b9-baad-151c57cfed3f@gmail.com> (message from Jim Porter on Fri, 2 Dec 2022 13:33:39 -0800) Subject: Re: bug#51993: 29.0.50; [PATCH for 29.1] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> <8e62e7aa-7050-6b35-9128-79517efa4557@gmail.com> <83edthgam5.fsf@gnu.org> <9b079bad-8d51-02b9-baad-151c57cfed3f@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 2 Dec 2022 13:33:39 -0800 > Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org > From: Jim Porter > > > And here you completely rewrote a function. > > Thinking about this some more, that change wasn't strictly necessary for > 29.1, since it should really just be dead code, and won't hurt anything. > I've split this part out into a separate commit that we could apply to > only the master branch. That simplifies the first commit (for 29.1) a > fair bit. Thanks, I'm okay with committing these two patches, each one to its branch. (But I guess you need to wait with installing the second one until the first one is merged to master, right?) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 04 17:26:21 2022 Received: (at 51993) by debbugs.gnu.org; 4 Dec 2022 22:26:21 +0000 Received: from localhost ([127.0.0.1]:60165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1xRE-0003VV-NQ for submit@debbugs.gnu.org; Sun, 04 Dec 2022 17:26:20 -0500 Received: from mail-pj1-f41.google.com ([209.85.216.41]:54799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1xR9-0003VP-W4 for 51993@debbugs.gnu.org; Sun, 04 Dec 2022 17:26:18 -0500 Received: by mail-pj1-f41.google.com with SMTP id o12so9547237pjo.4 for <51993@debbugs.gnu.org>; Sun, 04 Dec 2022 14:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=cYHdAnGkKLVyWxO94W0wQYtsWqxHzzELWcvl0GxDZ8Q=; b=XdKGqeinhAUZ/MP3U034kAvtEDaT6swunthYFDHEP/yf58YkIWeJIw5FCacG3xRsbW r+mdsA0H4JE5JB6u2hshrF5VhJLFTlaB2vDCdpB7lLvpPOALi06b8+pYFC/rDp+lSzKu ZDLUfG8685kO+qJjB8FHUgR/AzIIvyZvm7cPO8XjkudN0JSzEy5pEqa+99GybyW+VrSC Di/P08yMUXfzgzRhc3nFxlktzUSGvIrm+Bz/H7zIsvttjis6roH1WdzizcXVnaB1IwPK 9EppPrxsLV2SIpqVqwlhGDq786Gmm9EcbNgwCltixppCKBmvHUmf8Y0yPWEtwU9LpVDu UQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cYHdAnGkKLVyWxO94W0wQYtsWqxHzzELWcvl0GxDZ8Q=; b=kTAZtM01QjpoRVZBpfvEv1pFtuQecwbZugsjS/uZUDXRFGJkjCk2DwSTBS5MVm9jQU Ysw88jVWrNiFb4bmJwBlZBY44R2zv5kuZBt4siQNc3wiec1OB92wOpvhhDZGiZpip0Ft a0AyL0AM/zt1suOaUh9xUY1MrjssztzFTIQWPkStjdrHU29T219A30QEv/50Oe/rs6nP 4ETd6Ivo1m3bWRHGvZpaI7YYeLAsNYmo6JZBD2xhrjcto3bWKIu9Q8mYeNmHd38Qrjw0 Vy26IgqwVB2Hk7c/z3Ar3HiP8AH3FXhjB7Kd4cD0PudkpzJC8JOTv7RjEyRd7oJ2W6YU 7UqQ== X-Gm-Message-State: ANoB5pkKa2Ech8h7pvfUG7fNsxRmtVZ9PJ/p7tyvwEnYKx7KeaTYJn9U qgRATeVV4nMt3mMPUVXwb6s= X-Google-Smtp-Source: AA0mqf4tfkakBzMbcdUP+/oFFFJrwMKpzaEYISC0BHjHDT+n6JfhOJ0leWW/lZmuSAKo4zSBYewwuw== X-Received: by 2002:a17:902:a3c9:b0:179:f580:bca5 with SMTP id q9-20020a170902a3c900b00179f580bca5mr69104607plb.139.1670192769804; Sun, 04 Dec 2022 14:26:09 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id j7-20020a170902da8700b0018980f14ecfsm9250747plx.115.2022.12.04.14.26.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Dec 2022 14:26:09 -0800 (PST) Message-ID: <06bcc0b2-6bee-48e4-b76c-67dfbf1bed86@gmail.com> Date: Sun, 4 Dec 2022 14:26:06 -0800 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH for 29.1] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> <8e62e7aa-7050-6b35-9128-79517efa4557@gmail.com> <83edthgam5.fsf@gnu.org> <9b079bad-8d51-02b9-baad-151c57cfed3f@gmail.com> <83fsdv9hnl.fsf@gnu.org> From: Jim Porter In-Reply-To: <83fsdv9hnl.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993 Cc: larsi@gnus.org, 51993@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 12/4/2022 9:56 AM, Eli Zaretskii wrote: > Thanks, I'm okay with committing these two patches, each one to its branch. > (But I guess you need to wait with installing the second one until the first > one is merged to master, right?) Thanks again for the reviews. I've merged the first part to the 29 branch as 4bcdb1cc65bf779b6479f99a7aa767ab83b3bae1. Like you said, the second patch (for master) should wait until the next merge of 29 to master. There's no rush on this though, so I'll just set a reminder to do that when it's ready. (I could theoretically merge 29 to master myself, but since I've never done that, I'll leave it to the experts. :)) From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 06 17:20:42 2022 Received: (at 51993-done) by debbugs.gnu.org; 6 Dec 2022 22:20:42 +0000 Received: from localhost ([127.0.0.1]:45481 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2gIs-0000KA-He for submit@debbugs.gnu.org; Tue, 06 Dec 2022 17:20:42 -0500 Received: from mail-pj1-f43.google.com ([209.85.216.43]:33754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2gIo-0000K2-EN for 51993-done@debbugs.gnu.org; Tue, 06 Dec 2022 17:20:41 -0500 Received: by mail-pj1-f43.google.com with SMTP id fa4-20020a17090af0c400b002198d1328a0so2472579pjb.0 for <51993-done@debbugs.gnu.org>; Tue, 06 Dec 2022 14:20:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=w619K8FBqn0YdpFUWKp6wlref78ETgfQnyJUNMhDgHs=; b=jbqHOqXgAhVqX2gjI9Spcg5QdSMyRhfayC78VL+EgIFBsyKaCog2HFPE2aGBVPONTw Ybi8pApd7PjtNErdHDq0bG62emTWWdVRUr+ATpoe/cKF9PQBUqzgPnbymQA0yJtrHBia BQ5GXH0YlO24uMLgbPuuUqjkXHGsgyn3nAsxGTy6CJxleCyl1uEEYx6V0jdjmDbw0Ngd pLWf1pzcyUrx3vfJz+u8bKrsHM6Z7IqNNLCdHE7c0s+HkLmisbuJI1P6iT1Y4h+HU10l yijto3J6i57d0L86aHi7F5A+3LqEt53uZ96s55xpCh3wTg1N5reGF75dhlRIX8MecgJ6 W/bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w619K8FBqn0YdpFUWKp6wlref78ETgfQnyJUNMhDgHs=; b=lRRwgSNPnpvNxX0hA2XlJ+tTkQWUJjE4d5P3PYYHi/HIwcj7FOnLRk8RfqUPk1lSzt tG3jDXVC8ZAJUuNwzqwdADkkIIgh6FOdo3JgosYBlhoZNykwuWi8s0Y5ENjVn2Ox7Iwy tqe5QYja0IMX0jp0QaO1LBpkDkmjRVXKAuJHhbDtSaaYSOoS9SQ91qz+4HF+iZEQOozA Kw5aiiKaQaTS2miCNlzTSvNa5z+q4++2w90E1FDZAlU703bS+NByWDy32NnEjSW5pRF2 V9ugzPiJUdEpC1VBSGWcMxa9yfw3RYFUNr2rMR1Db3cXukqPZCVQrdHhgAbYkYeMQ0HC iQiA== X-Gm-Message-State: ANoB5pk7ieAvwKSKfnrkIG5GIyL3/JoB81338DybyMmukexzwLVkzeML IUeEnbwWSFFaPhGcRM+QRBA= X-Google-Smtp-Source: AA0mqf4TYjfiZSphjz4JefXF+M6SBQEWR6S8xSIHoPt5W0kwAGbRNePag5MBqyJAQ3hPR8rjn8kd3Q== X-Received: by 2002:a17:90a:e556:b0:219:b502:a2d2 with SMTP id ei22-20020a17090ae55600b00219b502a2d2mr17227293pjb.230.1670365232630; Tue, 06 Dec 2022 14:20:32 -0800 (PST) Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id m17-20020a170902f21100b00189393ab02csm13038647plc.99.2022.12.06.14.20.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Dec 2022 14:20:31 -0800 (PST) Message-ID: <1f9d803c-0ffd-3b16-07f7-8c90fe7ba546@gmail.com> Date: Tue, 6 Dec 2022 14:20:30 -0800 MIME-Version: 1.0 Subject: Re: bug#51993: 29.0.50; [PATCH for 29.1] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files Content-Language: en-US From: Jim Porter To: Eli Zaretskii References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@gmail.com> <79a53ecc-dbfc-d088-d80d-96f349be794a@gmail.com> <834k7vw2vb.fsf@gnu.org> <87czc4tosz.fsf@gnus.org> <83lepoi58p.fsf@gnu.org> <83y1tbxbbt.fsf@gnu.org> <83h6zxwujo.fsf@gnu.org> <2738f071-c87f-72cf-226f-6e8597cb07a8@gmail.com> <83a65ouz0e.fsf@gnu.org> <83lenrghhg.fsf@gnu.org> <8e62e7aa-7050-6b35-9128-79517efa4557@gmail.com> <83edthgam5.fsf@gnu.org> <9b079bad-8d51-02b9-baad-151c57cfed3f@gmail.com> <83fsdv9hnl.fsf@gnu.org> <06bcc0b2-6bee-48e4-b76c-67dfbf1bed86@gmail.com> In-Reply-To: <06bcc0b2-6bee-48e4-b76c-67dfbf1bed86@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51993-done Cc: larsi@gnus.org, 51993-done@debbugs.gnu.org, gregory@heytings.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 12/4/2022 2:26 PM, Jim Porter wrote: > Thanks again for the reviews. I've merged the first part to the 29 > branch as 4bcdb1cc65bf779b6479f99a7aa767ab83b3bae1. > > Like you said, the second patch (for master) should wait until the next > merge of 29 to master. And now I've merged the cleanup patch to master as bcf4d96db3a61e0d02a584fa9fceb049cdad6fe8. Closing this bug now. Thanks once again. From unknown Mon Jun 16 23:46:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 04 Jan 2023 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator