GNU bug report logs - #51993
29.0.50; [PATCH] Killing emacsclient terminal with `server-stop-automatically' doesn't prompt to save files

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Jim Porter <jporterbugs@HIDDEN>; Keywords: patch; dated Sat, 20 Nov 2021 04:30:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 19:31:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 29 14:31:35 2021
Received: from localhost ([127.0.0.1]:39485 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mrmN6-0002M4-Me
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1mrmN5-0002HD-Ic
 for 51993 <at> 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 <at> 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 <gregory@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <79a53ecc-dbfc-d088-d80d-96f349be794a@HIDDEN> <834k7vw2vb.fsf@HIDDEN>
 <c4dabc8c0acfb8c1ff3a@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
Message-ID: <0cbd22ae-e1e9-c6fb-a907-48bcc98dc6f2@HIDDEN>
Date: Mon, 29 Nov 2021 11:31:20 -0800
MIME-Version: 1.0
In-Reply-To: <c4dabc8c0acfb8c1ff3a@HIDDEN>
Content-Type: multipart/mixed; boundary="------------E7EEC49F63D237D7D1D22B4B"
Content-Language: en-US
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 51993
Cc: larsi@HIDDEN, 51993 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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
ZWQgdG8gYmUgc2F2ZWQuCgpJZiBFbWFjcyB3YXMgc3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lcnMta2lsbC1lbWFjcyBhcmcpKSkKCSAg
ICAoKHByb2Nlc3NwIHByb2MpCiAgICAgICAgICAgICAoaWYgKHNlcS1zb21lCiAgICAgICAg
ICAgICAgICAgIChsYW1iZGEgKGZyYW1lKQogICAgICAgICAgICAgICAgICAgIChsZXQgKChw
IChmcmFtZS1wYXJhbWV0ZXIgZnJhbWUgJ2NsaWVudCkpKQogICAgICAgICAgICAgICAgICAg
ICAgKHVubGVzcyAoYW5kIChkYWVtb25wKSAobnVsbCBwKSkKICAgICAgICAgICAgICAgICAg
ICAgICAgKG5vdCAoZXF1YWwgcHJvYyBwKSkpKSkKICAgICAgICAgICAgICAgICAgKGZyYW1l
LWxpc3QpKQogICAgICAgICAgICAgICAgIDs7IElmIHRoZXJlJ3MgYSBmcmFtZSBub3QgZnJv
bSB0aGlzIGNsaWVudCwgb25seSBkZWxldGUgdGhlCiAgICAgICAgICAgICAgICAgOzsgY2xp
ZW50LgoJICAgICAgICAgKGxldCAoKGJ1ZmZlcnMgKHByb2Nlc3MtZ2V0IHByb2MgJ2J1ZmZl
cnMpKSkKCSAgICAgICAgICAgKHNhdmUtc29tZS1idWZmZXJzCgkgICAgICAgICAgICBhcmcg
KGlmIGJ1ZmZlcnMKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IE9ubHkgZmlsZXMg
ZnJvbSBlbWFjc2NsaWVudCBmaWxlIGxpc3QuCgkJICAgICAgICAgICAgKGxhbWJkYSAoKSAo
bWVtcSAoY3VycmVudC1idWZmZXIpIGJ1ZmZlcnMpKQogICAgICAgICAgICAgICAgICAgICAg
ICAgIDs7IE5vIGVtYWNzY2xpZW50IGZpbGUgbGlzdDogZG9uJ3Qgb3ZlcnJpZGUKICAgICAg
ICAgICAgICAgICAgICAgICAgICA7OyBgc2F2ZS1zb21lLWJ1ZmZlcnMtZGVmYXVsdC1wcmVk
aWNhdGUnICh1bmxlc3MKICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBBUkcgaXMgbm9u
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Rlcm1pbmFsKQogIChhZHZpY2UtYWRk
ICMnc2VydmVyLWtpbGwtZW1hY3MtcXVlcnktZnVuY3Rpb24gOm92ZXJyaWRlCiAgICAgICAg
ICAgICAgIyd1c2VyLS1zZXJ2ZXIta2lsbC1lbWFjcy1xdWVyeS1mdW5jdGlvbikKICAoYWRk
LWhvb2sgJ2RlbGV0ZS1mcmFtZS1mdW5jdGlvbnMgIyd1c2VyLS1oYW5kbGUtZGVsZXRlLWZy
YW1lKSkK
--------------E7EEC49F63D237D7D1D22B4B--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 19:12:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 29 14:12:32 2021
Received: from localhost ([127.0.0.1]:39408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mrm4l-0000aw-L1
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1mrm4k-0000ak-B5
 for 51993 <at> 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 <at> 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 <eliz@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <79a53ecc-dbfc-d088-d80d-96f349be794a@HIDDEN> <834k7vw2vb.fsf@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
Message-ID: <514c9cb1-aa94-4332-0740-ad51310c2014@HIDDEN>
Date: Mon, 29 Nov 2021 11:12:22 -0800
MIME-Version: 1.0
In-Reply-To: <834k7vw2vb.fsf@HIDDEN>
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@HIDDEN, 51993 <at> debbugs.gnu.org, gregory@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 13:40:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 29 08:40:12 2021
Received: from localhost ([127.0.0.1]:37431 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mrgtA-0002mX-3K
	for submit <at> 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 <gregory@HIDDEN>) id 1mrgt8-0002mM-0a
 for 51993 <at> 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 <gregory@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
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@HIDDEN>
Message-ID: <c4dabc8c0acfb8c1ff3a@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <79a53ecc-dbfc-d088-d80d-96f349be794a@HIDDEN> <834k7vw2vb.fsf@HIDDEN>
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 <jporterbugs@HIDDEN>, larsi@HIDDEN, 51993 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 12:41:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 29 07:41:25 2021
Received: from localhost ([127.0.0.1]:37339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mrfyH-0001Ee-AD
	for submit <at> 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 <eliz@HIDDEN>) id 1mrfyF-0001ES-IC
 for 51993 <at> 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 <eliz@HIDDEN>)
 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 <eliz@HIDDEN>)
 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@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <79a53ecc-dbfc-d088-d80d-96f349be794a@HIDDEN> (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@HIDDEN>
 <79a53ecc-dbfc-d088-d80d-96f349be794a@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51993
Cc: larsi@HIDDEN, 51993 <at> debbugs.gnu.org, gregory@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Jim Porter <jporterbugs@HIDDEN>
> Cc: eliz@HIDDEN, larsi@HIDDEN, gregory@HIDDEN
> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 29 Nov 2021 05:39:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 29 00:39:55 2021
Received: from localhost ([127.0.0.1]:36747 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mrZON-0002JX-7O
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1mrZOK-0002JJ-VF
 for 51993 <at> 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 <at> 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 <jporterbugs@HIDDEN>
To: 51993 <at> debbugs.gnu.org
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
Message-ID: <79a53ecc-dbfc-d088-d80d-96f349be794a@HIDDEN>
Date: Sun, 28 Nov 2021 21:39:46 -0800
MIME-Version: 1.0
In-Reply-To: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
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@HIDDEN, gregory@HIDDEN, larsi@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 24 Nov 2021 01:10:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 20:10:48 2021
Received: from localhost ([127.0.0.1]:52539 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpgoB-0004Fy-Lh
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1mpgo9-0004Fg-Kq
 for 51993 <at> 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 <at> 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 <gregory@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN> <890d44ded2b56811ceff@HIDDEN>
 <64c7eb70-d941-9c98-4513-a2bdc44e7953@HIDDEN>
 <890d44ded2fa8ff77ab2@HIDDEN>
 <1623621b-d2a6-a68c-ac28-cdd371886b11@HIDDEN>
 <890d44ded2c42fe531a1@HIDDEN>
 <60d6439a-d2be-cbb4-b979-312a35216758@HIDDEN>
 <890d44ded244c5e34000@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
Message-ID: <f5f36c4d-3100-e40f-b2e2-30c643106d9f@HIDDEN>
Date: Tue, 23 Nov 2021 17:10:38 -0800
MIME-Version: 1.0
In-Reply-To: <890d44ded244c5e34000@HIDDEN>
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@HIDDEN, 51993 <at> debbugs.gnu.org, eliz@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 23:59:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 18:59:45 2021
Received: from localhost ([127.0.0.1]:52495 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpfhQ-0002Rs-QC
	for submit <at> 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 <gregory@HIDDEN>) id 1mpfhP-0002Rh-3a
 for 51993 <at> 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 <gregory@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
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@HIDDEN>
Message-ID: <890d44ded244c5e34000@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN> <890d44ded2b56811ceff@HIDDEN>
 <64c7eb70-d941-9c98-4513-a2bdc44e7953@HIDDEN>
 <890d44ded2fa8ff77ab2@HIDDEN>
 <1623621b-d2a6-a68c-ac28-cdd371886b11@HIDDEN>
 <890d44ded2c42fe531a1@HIDDEN>
 <60d6439a-d2be-cbb4-b979-312a35216758@HIDDEN>
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@HIDDEN, 51993 <at> debbugs.gnu.org, eliz@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 23:43:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 18:43:12 2021
Received: from localhost ([127.0.0.1]:52486 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpfRP-0001z3-Gk
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1mpfRK-0001yZ-K5
 for 51993 <at> 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 <at> 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 <gregory@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN> <890d44ded2b56811ceff@HIDDEN>
 <64c7eb70-d941-9c98-4513-a2bdc44e7953@HIDDEN>
 <890d44ded2fa8ff77ab2@HIDDEN>
 <1623621b-d2a6-a68c-ac28-cdd371886b11@HIDDEN>
 <890d44ded2c42fe531a1@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
Message-ID: <60d6439a-d2be-cbb4-b979-312a35216758@HIDDEN>
Date: Tue, 23 Nov 2021 15:42:59 -0800
MIME-Version: 1.0
In-Reply-To: <890d44ded2c42fe531a1@HIDDEN>
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@HIDDEN, 51993 <at> debbugs.gnu.org, eliz@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 22:49:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 17:49:57 2021
Received: from localhost ([127.0.0.1]:52441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpebs-0000UW-OT
	for submit <at> 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 <gregory@HIDDEN>) id 1mpebn-0000UE-8z
 for 51993 <at> 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 <gregory@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
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@HIDDEN>
Message-ID: <890d44ded2c42fe531a1@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN> <890d44ded2b56811ceff@HIDDEN>
 <64c7eb70-d941-9c98-4513-a2bdc44e7953@HIDDEN>
 <890d44ded2fa8ff77ab2@HIDDEN>
 <1623621b-d2a6-a68c-ac28-cdd371886b11@HIDDEN>
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@HIDDEN, 51993 <at> debbugs.gnu.org, eliz@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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: 
> <https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02163.html>.
>

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 22:08:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 17:08:15 2021
Received: from localhost ([127.0.0.1]:52426 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpdxX-0007kf-CJ
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1mpdxV-0007kO-4O
 for 51993 <at> 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 <at> 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 <gregory@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN> <890d44ded2b56811ceff@HIDDEN>
 <64c7eb70-d941-9c98-4513-a2bdc44e7953@HIDDEN>
 <890d44ded2fa8ff77ab2@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
Message-ID: <1623621b-d2a6-a68c-ac28-cdd371886b11@HIDDEN>
Date: Tue, 23 Nov 2021 14:08:05 -0800
MIME-Version: 1.0
In-Reply-To: <890d44ded2fa8ff77ab2@HIDDEN>
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@HIDDEN, 51993 <at> debbugs.gnu.org, eliz@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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: 
<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-10/msg02163.html>.

>> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 20:37:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 15:37:10 2021
Received: from localhost ([127.0.0.1]:52344 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpcXO-0005B6-9F
	for submit <at> 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 <gregory@HIDDEN>) id 1mpcXK-0005Aw-PF
 for 51993 <at> 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 <gregory@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
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@HIDDEN>
Message-ID: <890d44ded2fa8ff77ab2@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN> <890d44ded2b56811ceff@HIDDEN>
 <64c7eb70-d941-9c98-4513-a2bdc44e7953@HIDDEN>
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 <eliz@HIDDEN>, 51993 <at> debbugs.gnu.org, larsi@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 18:25:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 13:25:28 2021
Received: from localhost ([127.0.0.1]:52255 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpaTv-0007iZ-Ix
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1mpaTs-0007iL-PR
 for 51993 <at> 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 <at> 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 <gregory@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN> <890d44ded2b56811ceff@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
Message-ID: <64c7eb70-d941-9c98-4513-a2bdc44e7953@HIDDEN>
Date: Tue, 23 Nov 2021 10:25:19 -0800
MIME-Version: 1.0
In-Reply-To: <890d44ded2b56811ceff@HIDDEN>
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@HIDDEN, 51993 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 23 Nov 2021 09:48:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 23 04:48:20 2021
Received: from localhost ([127.0.0.1]:50043 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpSPT-0001GL-QW
	for submit <at> 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 <gregory@HIDDEN>) id 1mpSPP-0001G9-Jr
 for 51993 <at> 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 <gregory@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
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@HIDDEN>
Message-ID: <890d44ded2b56811ceff@HIDDEN>
References: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
 <83pmqvti49.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="sgDcgKw0xL"
Content-ID: <890d44ded22c70b308ee@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 51993
Cc: Jim Porter <jporterbugs@HIDDEN>, 51993 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--sgDcgKw0xL
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-ID: <890d44ded27785cbe645@HIDDEN>


>> 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@HIDDEN>
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kIGZyb20gdGhlIHVzZXIgaW5pdCBmaWxlLiINCkBAIC0xODE4
LDkgKzE4MzYsMTAgQEAgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseQ0KICAg
ICAgIChzZXRxIHNlcnZlci1zdG9wLWF1dG9tYXRpY2FsbHkgbmlsKQ0KICAg
ICAgIChydW4td2l0aC10aW1lciAxMCAyDQogCQkgICAgICAjJ3NlcnZlci1z
dG9wLWF1dG9tYXRpY2FsbHktLW1heWJlLWtpbGwtZW1hY3MpKQ0KLSAgICAg
KChlcSBhcmcgJ2RlbGV0ZS1mcmFtZSkNCisgICAgICgoZXEgYXJnICdkZWxl
dGUtbGFzdC1mcmFtZSkNCiAgICAgICAoYWRkLWhvb2sgJ2RlbGV0ZS1mcmFt
ZS1mdW5jdGlvbnMNCiAJCSMnc2VydmVyLXN0b3AtYXV0b21hdGljYWxseS0t
aGFuZGxlLWRlbGV0ZS1mcmFtZSkpDQorICAgICAoKGVxIGFyZyAna2lsbC1s
YXN0LXRlcm1pbmFsKSkNCiAgICAgICgoZXEgYXJnICdraWxsLXRlcm1pbmFs
KSkNCiAgICAgICh0DQogICAgICAgKGVycm9yICJVbmV4cGVjdGVkIGFyZ3Vt
ZW50IikpKSkpDQotLSANCjIuMzMuMA0KDQo=

--sgDcgKw0xL--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at 51993 <at> debbugs.gnu.org:


Received: (at 51993) by debbugs.gnu.org; 20 Nov 2021 07:13:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 20 02:13:17 2021
Received: from localhost ([127.0.0.1]:41441 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1moKYn-0004H4-Fs
	for submit <at> 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 <eliz@HIDDEN>) id 1moKYk-0004Gm-PV
 for 51993 <at> 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 <eliz@HIDDEN>)
 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 <eliz@HIDDEN>)
 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@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>, Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN> (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@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51993
Cc: 51993 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Jim Porter <jporterbugs@HIDDEN>
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 20 Nov 2021 04:29:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 19 23:29:53 2021
Received: from localhost ([127.0.0.1]:41155 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1moI0e-0007gp-VY
	for submit <at> 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 <jporterbugs@HIDDEN>) id 1moI0c-0007gh-E7
 for submit <at> 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 <jporterbugs@HIDDEN>)
 id 1moI0c-00005X-8K
 for bug-gnu-emacs@HIDDEN; 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 <jporterbugs@HIDDEN>)
 id 1moI0a-0006kT-9N
 for bug-gnu-emacs@HIDDEN; Fri, 19 Nov 2021 23:29:50 -0500
Received: by mail-lf1-x134.google.com with SMTP id t26so52359268lfk.9
 for <bug-gnu-emacs@HIDDEN>; 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 <bug-gnu-emacs@HIDDEN>
 (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 <jporterbugs@HIDDEN>
Subject: 29.0.50; [PATCH] Killing emacsclient terminal with
 `server-stop-automatically' doesn't prompt to save files
To: bug-gnu-emacs@HIDDEN
Message-ID: <9e47c871-a2c3-d764-bec9-d87abf3efe83@HIDDEN>
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@HIDDEN; 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 <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
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
dG8gZW1hY3NjbGllbnQg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ZSBncm91cHMgb2YKKyAgICAgICAgICAgICAgIDs7IG5vd2FpdCBmcmFtZXMgY3Vy
cmVudGx5LgorICAgICAgICAgICAgICAgKHByb2duIChzYXZlLXNvbWUtYnVmZmVycyBhcmcp
CisgICAgICAgICAgICAgICAgICAgICAgKGRlbGV0ZS1mcmFtZSkpCisgICAgICAgICAgICAg
OzsgSWYgd2UncmUgdGhlIGxhc3QgZnJhbWUgc3RhbmRpbmcsIGtpbGwgRW1hY3MuCisgICAg
ICAgICAgICAgKHNhdmUtYnVmZmVycy1raWxsLWVtYWNzIGFyZykpKQorICAgICAgICAgICgo
cHJvY2Vzc3AgcHJvYykKKyAgICAgICAgICAgKGlmIChzZXEtc29tZQorICAgICAgICAgICAg
ICAgIChsYW1iZGEgKGZyYW1lKQorICAgICAgICAgICAgICAgICAgKGxldCAoKHAgKGZyYW1l
LXBhcmFtZXRlciBmcmFtZSAnY2xpZW50KSkpCisgICAgICAgICAgICAgICAgICAgICh1bmxl
c3MgKGFuZCBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5IChudWxsIHApKQorICAgICAgICAg
ICAgICAgICAgICAgIChub3QgKGVxdWFsIHByb2MgcCkpKSkpCisgICAgICAgICAgICAgICAg
KGZyYW1lLWxpc3QpKQorICAgICAgICAgICAgICAgOzsgSWYgdGhlcmUgYXJlIGFueSBmcmFt
ZXMgZnJvbSBvdGhlciBjbGllbnRzLCBvbmx5CisgICAgICAgICAgICAgICA7OyBkZWxldGUg
dGhpcyBjbGllbnQuICBJZiBgc2VydmVyLXN0b3AtYXV0b21hdGljYWxseScKKyAgICAgICAg
ICAgICAgIDs7IGlzIG5pbCwgY2hlY2sgZm9yIGZyYW1lcyBmcm9tIHRoZSBzZXJ2ZXIgcHJv
Y2VzcyBhcworICAgICAgICAgICAgICAgOzsgd2VsbC4KKyAgICAgICAgICAgICAgIChsZXQg
KChidWZmZXJzIChwcm9jZXNzLWdldCBwcm9jICdidWZmZXJzKSkpCisgICAgICAgICAgICAg
ICAgIChzYXZlLXNvbWUtYnVmZmVycworICAgICAgICAgICAgICAgICAgYXJnIChpZiBidWZm
ZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IE9ubHkgZmlsZXMgZnJvbSBlbWFj
c2NsaWVudCBmaWxlIGxpc3QuCisgICAgICAgICAgICAgICAgICAgICAgICAgIChsYW1iZGEg
KCkgKG1lbXEgKGN1cnJlbnQtYnVmZmVyKSBidWZmZXJzKSkKKyAgICAgICAgICAgICAgICAg
ICAgICAgIDs7IE5vIGVtYWNzY2xpZW50IGZpbGUgbGlzdDogZG9uJ3Qgb3ZlcnJpZGUKKyAg
ICAgICAgICAgICAgICAgICAgICAgIDs7IGBzYXZlLXNvbWUtYnVmZmVycy1kZWZhdWx0LXBy
ZWRpY2F0ZScKKyAgICAgICAgICAgICAgICAgICAgICAgIDs7ICh1bmxlc3MgQVJHIGlzIG5v
bi1uaWwpLCBzaW5jZSB3ZSdyZSBub3QKKyAgICAgICAgICAgICAgICAgICAgICAgIDs7IGtp
bGxpbmcgRW1hY3MgKHVubGlrZQorICAgICAgICAgICAgICAgICAgICAgICAgOzsgYHNhdmUt
YnVmZmVycy1raWxsLWVtYWNzJykuCisgICAgICAgICAgICAgICAgICAgICAgICAoYW5kIGFy
ZyB0KSkpCisgICAgICAgICAgICAgICAgIChzZXJ2ZXItZGVsZXRlLWNsaWVudCBwcm9jKSkK
KyAgICAgICAgICAgICA7OyBJZiBhbGwgZnJhbWVzIGFyZSBmcm9tIHRoaXMgY2xpZW50LCBr
aWxsIEVtYWNzLgorICAgICAgICAgICAgIChzYXZlLWJ1ZmZlcnMta2lsbC1lbWFjcyBhcmcp
KSkKKyAgICAgICAgICAodCAoZXJyb3IgIkludmFsaWQgY2xpZW50IGZyYW1lIikpKSkpCiAK
IChkZWZ1biBzZXJ2ZXItc3RvcC1hdXRvbWF0aWNhbGx5LS1oYW5kbGUtZGVsZXRlLWZyYW1l
IChmcmFtZSkKICAgIkhhbmRsZSBkZWx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AgICAgICAgIDs7IE5vdGU6IGBzZXJ2ZXItZGVsZXRlLWNsaWVudCcgc2V0
cyBgY2xpZW50JyB0byBuaWwKKyAgICAgICAgICAgICA7OyBiZWZvcmUgY2FsbGluZyBgZGVs
ZXRlLWZyYW1lJy4gVGhhdCdzIGdvb2QsIHNpbmNlIHdlCisgICAgICAgICAgICAgOzsgZG9u
J3Qgd2FudCB0byBjYWxsIGBzYXZlLWJ1ZmZlcnMta2lsbC1lbWFjcycgaW4gdGhhdAorICAg
ICAgICAgICAgIDs7IGNhc2UgYW55d2F5LgorICAgICAgICAgICAgIChmcmFtZS1wYXJhbWV0
ZXIgZnJhbWUgJ2NsaWVudCkKKyAgICAgICAgICAgICAobnVsbCAoY2RkciAoZnJhbWUtbGlz
dCkpKSkKKyAgICAoc2F2ZS1idWZmZXJzLWtpbGwtZW1hY3MpKSkKIAogKGRlZnVuIHNlcnZl
ci1zdG9wLWF1dG9tYXRpY2FsbHktLW1heWJlLWtpbGwtZW1hY3MgKCkKICAgIkhhbmRsZSBj
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
VENIIDIvMl0gRG9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ZWFkeSBoYWQgYSBzZXJ2ZXIsIGNsZWFyIG91dCBhc3NvY2lh
dGVkIHN0YXR1cy4KICAgICAgICh3aGlsZSBzZXJ2ZXItY2xpZW50cwotCShzZXJ2ZXItZGVs
ZXRlLWNsaWVudCAoY2FyIHNlcnZlci1jbGllbnRzKSkpCisJKHNlcnZlci1kZWxldGUtY2xp
ZW50IChjYXIgc2VydmVyLWNsaWVudHMpIG5vZnJhbWUpKQogICAgICAgOzsgTm93IGFueSBw
cmV2aW91cyBzZXJ2ZXIgaXMgcHJvcGVybHkgc3RvcHBlZC4KICAgICAgIChpZiBsZWF2ZS1k
ZWFkCiAJICAocHJvZ24KQEAgLTc0MCw3ICs3NDQsNyBAQCBzZXJ2ZXItc3RhcnQKIChkZWZ1
biBzZXJ2ZXItZm9yY2Utc3RvcCAoKQogICAiS2lsbCBhbGwgY29ubmVjdGlvbnMgdG8gdGhl
IGN1cnJlbnQgc2VydmVyLgogVGhpcyBmdW5jdGlvbiBpcyBtZWFudCB0byBiZSBjYWxsZWQg
ZnJvbSBga2lsbC1lbWFjcy1ob29rJy4iCi0gIChzZXJ2ZXItc3RhcnQgdCB0KSkKKyAgKHNl
cnZlci1zdGFydCB0IHQgJ25vZnJhbWUpKQogCiA7OzsjIyNhdXRvbG9hZAogKGRlZnVuIHNl
cnZlci1mb3JjZS1kZWxldGUgKCZvcHRpb25hbCBuYW1lKQotLSAKMi4yNS4xCgo=
--------------C07135EFA8A344D076699CA3--




Acknowledgement sent to Jim Porter <jporterbugs@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#51993; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 29 Nov 2021 19:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.