GNU bug report logs - #31951
27.0.50; [PATCH] server-save-buffers-kill-terminal should respect save-some-buffers-default-predicate

Previous Next

Package: emacs;

Reported by: João Távora <joaotavora <at> gmail.com>

Date: Sat, 23 Jun 2018 16:24:02 UTC

Severity: minor

Tags: patch

Found in version 27.0.50

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 31951 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31951 <at> debbugs.gnu.org
Subject: Re: bug#31951: 27.0.50;
 [PATCH] server-save-buffers-kill-terminal should respect
 save-some-buffers-default-predicate
Date: Sun, 24 Jun 2018 21:22:48 +0100
Noam Postavsky <npostavs <at> gmail.com> writes:

> João Távora <joaotavora <at> gmail.com> writes:
>
>> If the Emacs client was started without an explicit list of buffers to
>> edit, save-some-buffers is called with t for PRED (save all buffers),
>> but that was before save-some-buffers-default-predicate existed.
>>
>> I don't see any reason why save-some-buffers-default-predicate shouldn't
>> be respected in server-save-buffers-kill-terminal (of course if ARG is
>> non-nil, we do pass t so that the previous behaviour remains).

> I think you meant
>
> +	      arg (if buffers
> +		      (lambda () (memq (current-buffer) buffers))
> +                   (and arg t))

Yes, of course.

> But I'm not sure if this change makes sense, seeing as
> save-buffers-kill-emacs also ignores
> save-some-buffers-default-predicate:
>
>     (defun save-buffers-kill-emacs (&optional arg)
>       [...]
>       ;; Don't use save-some-buffers-default-predicate, because we want
>       ;; to ask about all the buffers before killing Emacs.
>       (save-some-buffers arg t)

Right, but thats because, when killing Emacs, it is really the last
chance to save those buffers before they're potentially gone for good.

In contrast, almost since server-save-buffers-kill-terminal's inception,
it has had a provision for saving only a subset of buffers, by guessing
that the user's intention was to edit only the buffers passed to the
emacsclient command.  This, of course, may very well not be true, but
it's a good thing in my opinion.  So I think it's natural that it also
respects save-some-buffers-default-predicate, which is also designed to
loosen these conditions, but doesn't guess, because it requires
customization by the user.

Alternatively, we could have some
save-some-buffers-default-strict-predicate for the PRED=t situation, but
I think that's overenginneering it.  Of course I'm open to other ideas.
How would you make quitting a client terminal not bother you about those
pesky ChangeLog buffers?

João





This bug report was last modified 7 years and 23 days ago.

Previous Next


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