From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky 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 09:37:26 -0400 Message-ID: <87vaa8pap5.fsf@gmail.com> References: <87y3f5mq07.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 1529847368 22253 195.159.176.226 (24 Jun 2018 13:36:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 24 Jun 2018 13:36:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 31951@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 24 15:36:03 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 1fX5BR-0005eI-8z for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2018 15:36:01 +0200 Original-Received: from localhost ([::1]:41977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fX5DY-0002bl-KT for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Jun 2018 09:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fX5DR-0002be-7p for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 09:38:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fX5DN-0000vF-VU for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 09:38:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54065) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fX5DN-0000v9-Rt for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 09:38:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fX5DN-0005kq-IU for bug-gnu-emacs@gnu.org; Sun, 24 Jun 2018 09:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jun 2018 13:38: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.152984745622087 (code B ref 31951); Sun, 24 Jun 2018 13:38:01 +0000 Original-Received: (at 31951) by debbugs.gnu.org; 24 Jun 2018 13:37:36 +0000 Original-Received: from localhost ([127.0.0.1]:33729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fX5Cx-0005kB-Oh for submit@debbugs.gnu.org; Sun, 24 Jun 2018 09:37:35 -0400 Original-Received: from mail-it0-f52.google.com ([209.85.214.52]:55460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fX5Cw-0005jy-LL for 31951@debbugs.gnu.org; Sun, 24 Jun 2018 09:37:34 -0400 Original-Received: by mail-it0-f52.google.com with SMTP id 16-v6so8759171itl.5 for <31951@debbugs.gnu.org>; Sun, 24 Jun 2018 06:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=EEw9yEs2FkIkxI4npF3xuDVX5SYe8Og4mHiX8Ip1Ej0=; b=hHojuiuJDNym0DIJBYdiFFww0BR3dl0RcBO01LiHVaSdFsQx9ZGl052ZFawhLX609V Dvp5XiChLd2ptramsE8mn6+EJ6F5+rzzyrqmeMwF5900SnJJ5EpO7/ate5cZsLa2AASp QNWpiG9Jb5E2d9YA9PKGBiFSN/s9nJvJsWbnCuKdkTEkPwi1biQbpafmcwn7UpGl4q76 4z5Zi8vB0C3ybFwHRz5wRG0V4y2gri5+tZws3N8sUfz8TMJhInAbazf9N9BwxCSzH4H+ 8LT/ZEblVqhPgH20IN0bXdJGWMfKWdYepGUokmaRk2OXh3BHOqQnypVitfffDnIpaRWF ByVA== 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:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=EEw9yEs2FkIkxI4npF3xuDVX5SYe8Og4mHiX8Ip1Ej0=; b=cZwLF4R9AqfSKOe0BCFkQCigMgf98+z10iLnRtALwyy5TmLYprW1ngfOjo/5pSnw2U 7/gUmS4/cYvvZVA3Z4zpo+FH19/KqxiJYkADVsb2IBgnpIUmqNs3s5Qd5cVmTp+N6Qtr kpzjjVGLYbtCKb5VCXT4FbT3WtTeA5676BcmTiRuv7HkYGcqpl/GK9P2VLCSNGFXiBri GS6YHBdguDdQ5T1qBxWKO3GgGNGoyc0IGM3JkqMK4OObwM9GEWesm9S6r8s+OB3Ci6wu 8kU79MBThSWvRPH31B9Lxn3Q0vcqXKC7mKR235Zivl0j6Dg8fHOd+JyceVgj1bpRHsd0 q3PQ== X-Gm-Message-State: APt69E2xga9ZEjlEcGBFnvn2svy7c9BWvf42Lkr/YgRL/kFsSyfxKlZl FeeZpK70c1uIM6kLJOH0IFmz9A== X-Google-Smtp-Source: AAOMgpfmRHcyRFzj6M75MljGUaDurl1nn1WYBQePLbZPAmBKdLwz84VZNSDIq4t1/Y1Pqbvqq/UAVA== X-Received: by 2002:a24:154c:: with SMTP id 73-v6mr7473437itq.51.1529847448729; Sun, 24 Jun 2018 06:37:28 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id r16-v6sm2735754iod.59.2018.06.24.06.37.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Jun 2018 06:37:27 -0700 (PDT) In-Reply-To: <87y3f5mq07.fsf@gmail.com> ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sat, 23 Jun 2018 17:22:48 +0100") 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:147793 Archived-At: 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). > ;; If client is bufferless, emulate a normal Emacs exit > ;; and offer to save all buffers. Otherwise, offer to > ;; save only the buffers belonging to the client. > (save-some-buffers > - arg (if buffers > - (lambda () (memq (current-buffer) buffers)) > - t)) > + arg (and buffers > + (lambda () (memq (current-buffer) buffers)) > + (and arg t))) I think you meant + arg (if buffers + (lambda () (memq (current-buffer) buffers)) + (and arg t)) 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)