From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <87muvklysn.fsf@gmail.com> References: <87y3f5mq07.fsf@gmail.com> <87vaa8pap5.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1529871726 14433 195.159.176.226 (24 Jun 2018 20:22:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2018 20:22:06 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 31951@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 22:22:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1fXBWM-0003Zn-3R for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2018 22:22:02 +0200 Original-Received: from localhost ([::1]:43023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXBYR-0000DJ-Ku for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2018 16:24:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXBYL-0000D9-9q for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 16:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXBYH-0002v2-VV for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 16:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXBYH-0002un-QT for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 16:24:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fXBYH-0006lj-J6 for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 16:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jun 2018 20:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31951 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 31951-submit@debbugs.gnu.org id=B31951.152987178125925 (code B ref 31951); Sun, 24 Jun 2018 20:24:01 +0000 Original-Received: (at 31951) by debbugs.gnu.org; 24 Jun 2018 20:23:01 +0000 Original-Received: from localhost ([127.0.0.1]:34130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXBXJ-0006k1-3w for submit@debbugs.gnu.org; Sun, 24 Jun 2018 16:23:01 -0400 Original-Received: from mail-wm0-f45.google.com ([74.125.82.45]:51233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXBXH-0006jm-1v for 31951@debbugs.gnu.org; Sun, 24 Jun 2018 16:22:59 -0400 Original-Received: by mail-wm0-f45.google.com with SMTP id w137-v6so1681858wmw.1 for <31951@debbugs.gnu.org>; Sun, 24 Jun 2018 13:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=fw6ZZrpdzwZ43hfuz4/D0NND6CXKgIl91pCI+YfXBp4=; b=Z8pjJaFDPCRTyLEVueaLd5l9q2Xb6PmDSECInno6akxMmcGWhN18diiHC1VrMS8oVM VU/6Pkx2Iv8iRgJsafRzuJzOCx88X7QOah70PzBzVjWwjqhTTF1tATR9YD47WgmMrt/c 5uO61TuoOdHQ8cwWVICOCayXy0EXilyZlUpi+qyZPB41aMyuE5K+MrBvb0egpuv6Sl26 WBQ4A+4GZPcUvgUGv2jfKYvh+yjCLsR8ZouKoO0PQojpuZluGScBNynyGp98of9Ou+Lp DQ7iOV4N4HHJZnXdmuIV8dJtH09LM58lSx1C6LVdgRDJ8xljNqbUHbk5INlKq4dchFK2 hCMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=fw6ZZrpdzwZ43hfuz4/D0NND6CXKgIl91pCI+YfXBp4=; b=p2bkDCclkuzTrd9sidYeNZS6Ete+vU8/1/KCAtGNxWZzH2DHiIm+LbCKk+xL22sgsW zYscg0CzNOerJrw1Tyv2ZFlWKt5JBbwy1FxH0NcQpxanwhwA3vULstgG+TA0icyBf/Zf n69nuHo+lV36YV0f04jI3m7JGv9gPEIcVIYlFVrrj1sbLWpH26nic/EXZDHOBrUdrvJt 1SiL/AyBiLaJq6pw8cKW1zb8kaeOJTgay8eiJ5O1eSp+UYt4eMS6K/IhP7ompwJ6t+f7 HgRC2gpjGjZK8+EgqwvMb3Bz4cFF3Mv7XXcp2hIM7zLbbm9GLzpyYs/QQW5yBJyRxlGi 0wlQ== X-Gm-Message-State: APt69E1A09yalSiL7miD7NnkB5LhOlNWcGKZRceBsWezgdQrJYOg9pcG hQarHL3DFVsWrXHg4Ol8q0b5IAXn X-Google-Smtp-Source: ADUXVKJJKTbaeHz/u1RNbaP4IKpzxrYlzaH1tRv59YtD6Ywb6kgf86nmaVwG8Q1QhYxcN4PvX+2oxA== X-Received: by 2002:a1c:2350:: with SMTP id j77-v6mr6967796wmj.108.1529871773068; Sun, 24 Jun 2018 13:22:53 -0700 (PDT) Original-Received: from lolita.yourcompany.com (188.139.62.94.rev.vodafone.pt. [94.62.139.188]) by smtp.gmail.com with ESMTPSA id f188-v6sm1058987wmf.8.2018.06.24.13.22.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 13:22:52 -0700 (PDT) In-Reply-To: <87vaa8pap5.fsf@gmail.com> (Noam Postavsky's message of "Sun, 24 Jun 2018 09:37:26 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147799 Archived-At: Noam Postavsky writes: > Jo=C3=A3o T=C3=A1vora 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=3Dt 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=C3=A3o