From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-26 ee512e9: Ignore buffers whose name begins with a space in save-some-buffers Date: Fri, 22 Sep 2017 09:54:05 +0300 Message-ID: <83zi9ncjg2.fsf@gnu.org> References: <20170918202953.21378.63492@vcs0.savannah.gnu.org> <20170918202955.5043420AC4@vcs0.savannah.gnu.org> <87inge8skl.fsf@ericabrahamsen.net> <878th9z40r.fsf@ericabrahamsen.net> <831sn0fpk9.fsf@gnu.org> <87o9q3lt8s.fsf@ericabrahamsen.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1506063288 24616 195.159.176.226 (22 Sep 2017 06:54:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 22 Sep 2017 06:54:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 22 08:54:43 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvHrE-0005vk-JZ for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 08:54:40 +0200 Original-Received: from localhost ([::1]:56968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvHrL-0005rk-W1 for ged-emacs-devel@m.gmane.org; Fri, 22 Sep 2017 02:54:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvHqp-0005ra-KM for emacs-devel@gnu.org; Fri, 22 Sep 2017 02:54:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvHqk-0001UT-P6 for emacs-devel@gnu.org; Fri, 22 Sep 2017 02:54:15 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvHqk-0001UJ-LR; Fri, 22 Sep 2017 02:54:10 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3464 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dvHqk-0000BD-3p; Fri, 22 Sep 2017 02:54:10 -0400 In-reply-to: <87o9q3lt8s.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Thu, 21 Sep 2017 12:57:39 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218675 Archived-At: > From: Eric Abrahamsen > Date: Thu, 21 Sep 2017 12:57:39 -0700 > > > Are there any upsides and downsides to consider wrt this solution? If > > so, what are they? > > It isn't so much upsides and downsides, as being careful to add a single > bit of functionality, without messing up present behavior and > expectations for a highly-trafficked bit of code. I think we can agree: > > 1. To leave the buffer name out of it (don't handle leading spaces > differently) > 2. To require `buffer-offer-save' to be explicitly set non-nil in order > to to consider a non-file buffer for potential saving. I think > Kaushal's right that we should require both `buffer-offer-save' and > `write-contents-functions' to be non-nil > 3. To leave the current behavior of the PRED argument unchanged > > So I think Kaushal's solution is good: it won't change anything at all > except to add a clause saying "when `buffer-offer-save' and > `write-contents-functions' have been set non-nil, consider the buffer > for saving". That's only going to happen when someone explicitly > requests it. Reusing buffer-offer-save for this purpose sounds a strange solution for me. That variable already says that Emacs should offer saving the buffer, and now it will have to do double duty in a convoluted manner. It sounds like we are making the problem harder, rather than simpler, for modes to solve. IOW, if we require buffer-offer-save to be non-nil, why do we need to also require that write-contents-functions is non-nil? There are 2 clauses in the condition we are talking about, both require buffer-offer-save to be non-nil, and the only difference between them seems to be the condition of buffer size being positive. Is that what write-contents-functions is about -- to allow saving "empty" buffers?