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: Sat, 23 Jun 2018 17:22:48 +0100 Message-ID: <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 1529770926 2172 195.159.176.226 (23 Jun 2018 16:22:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 23 Jun 2018 16:22:06 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 31951@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 23 18: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 1fWlIW-0000Qc-Q5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jun 2018 18:22:01 +0200 Original-Received: from localhost ([::1]:39107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWlKe-0005ve-6v for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jun 2018 12:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWlKY-0005vX-04 for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 12:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWlKU-0002AK-Rw for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 12:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWlKU-0002AF-OC for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 12:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fWlKU-0001Bu-Gk for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 12:24:02 -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: Sat, 23 Jun 2018 16:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31951 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15297709864511 (code B ref -1); Sat, 23 Jun 2018 16:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Jun 2018 16:23:06 +0000 Original-Received: from localhost ([127.0.0.1]:33376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fWlJa-0001Ah-8m for submit@debbugs.gnu.org; Sat, 23 Jun 2018 12:23:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fWlJY-00019z-Hi for submit@debbugs.gnu.org; Sat, 23 Jun 2018 12:23:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWlJS-0001vP-D2 for submit@debbugs.gnu.org; Sat, 23 Jun 2018 12:22:59 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:45992) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fWlJS-0001vF-97 for submit@debbugs.gnu.org; Sat, 23 Jun 2018 12:22:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWlJR-0005mE-7L for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 12:22:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWlJO-0001uP-38 for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 12:22:57 -0400 Original-Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]:44203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWlJN-0001u1-SP for bug-gnu-emacs@gnu.org; Sat, 23 Jun 2018 12:22:54 -0400 Original-Received: by mail-wr0-x234.google.com with SMTP id p12-v6so7855619wrn.11 for ; Sat, 23 Jun 2018 09:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=3CMVUxTn+gYAW/kzudBdwSSywucS6DaA7rwDXkD2SxA=; b=ZIN8ESh3Goy2/X0VugRtsHB0PWnKVSNedzM7rACkfuZtTjoYd69r6LRcCQFbQf+xY8 NRaBm9nOmhPGRc0RXLwTEacyc89n2X3VVTihzOwICqgWSlbQ2ap9C0wcg0yiIFMhRyVf D84xvJp0Y4BqM0ncU6twymdVYSSQPhg9m55u4MK/fR+IQqPgXI/h7p7ftuCYYQCRuIQl mSs+lJqkVZa20XPEMKhTS5zB+dFukhdwqvzmXNxrXsKFJGvk0unEv7TpEI9qB4Dncexz Mg8ZVbF+79hL/yQVI4e1z2kFtNRvWvoqy0H+9K5BIO26O0ZoB2BoIpEDwAQdYkewBNPJ xNTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-transfer-encoding; bh=3CMVUxTn+gYAW/kzudBdwSSywucS6DaA7rwDXkD2SxA=; b=EK/Q9T0KIOfQ8EVcCfS7aaNpNedRRvy+wdrQsjTZWQKBzopmPed4Ya0VqEebjm2Ohi ORAsxy66JAit7f6s3YTZm2sFQMT3FBHyTEXpXla8egzwrAa2Fc7V8MSEHM3rjQLP+tHN 5ZKKkgZ7QV4Kly0fsPvOoo+cg+sLqOyjU9tiWc7th0XZzm29Vg9X6Fv1nqwI0aqxVxV1 I0OxTo70I9aEQGo5P186Uzc7Sof3/YCcLozZuTsDuC9+A26XtWR1I0NRSqWBIkBEp3SE R28ZrZvEM7VYotV0FpmMB+UWj6sOg/20BDOWYSKReCLei19PEkxtwAIxlI932PDUOFmD yplw== X-Gm-Message-State: APt69E3vU+/RTWxI9maqG4i2OsCi2sMYX1EJPr55jfT64novFPTs/59s YSQQqwI0eYxH9ZHfyKjbMSZfvuBs X-Google-Smtp-Source: AAOMgpf0CoVN0qiOptPYJTs9Rmqs13PZj//KKukYCABFtGT8JoKzC7M1AcSIKdcOuXkJb3jaqcaKNQ== X-Received: by 2002:adf:90af:: with SMTP id i44-v6mr1366787wri.146.1529770972086; Sat, 23 Jun 2018 09:22:52 -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 f24-v6sm3180675wmc.0.2018.06.23.09.22.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jun 2018 09:22:51 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:147777 Archived-At: Hi, 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). Trivial patch attached, Jo=C3=A3o diff --git a/lisp/server.el b/lisp/server.el index ff03cbe622..ac14ef314e 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1670,9 +1670,9 @@ server-save-buffers-kill-terminal ;; 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))) (server-delete-client proc))) (t (error "Invalid client frame")))))