From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Date: Mon, 21 Aug 2023 14:56:59 +0300 Message-ID: <83lee4vcac.fsf@gnu.org> References: <871qfxvvw9.fsf@breatheoutbreathe.in> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11624"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jonas@bernoul.li, 65414@debbugs.gnu.org To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 21 13:57:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qY3XB-0002oH-7B for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Aug 2023 13:57:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qY3Ws-0004M5-OB; Mon, 21 Aug 2023 07:57:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qY3Wm-00048t-Rf for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 07:57:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY3Wm-0004Ba-CP for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 07:57:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qY3Wo-000859-7S for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 07:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Aug 2023 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65414 X-GNU-PR-Package: emacs Original-Received: via spool by 65414-submit@debbugs.gnu.org id=B65414.169261901531048 (code B ref 65414); Mon, 21 Aug 2023 11:57:02 +0000 Original-Received: (at 65414) by debbugs.gnu.org; 21 Aug 2023 11:56:55 +0000 Original-Received: from localhost ([127.0.0.1]:55722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY3Wh-00084g-ES for submit@debbugs.gnu.org; Mon, 21 Aug 2023 07:56:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qY3Wf-00084S-Fu for 65414@debbugs.gnu.org; Mon, 21 Aug 2023 07:56:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qY3WU-0004AU-1w; Mon, 21 Aug 2023 07:56:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wJtJ9Ot1ah5z5irhYbq2ov4N+ED8SKxMthAFmDSzVQI=; b=Gx5AD+Y9Wc2l ZtDfbwQOw98ziYWuZXzcy8fNrNGHwdD/ORlSMnZRKkoUovSAJ77kg7aUoHouPtg4xiV9tv7ceKzKx iNJ57i83kt3w4ILHOXnw3xo9xap2+vQ9vge4hMMYDoqLJ/FNLZUD6t8Vr/T3lHjk8JBPpzkN0NY9w OmzEbV80dy9gPFp5RApNXvNghwnsKuHKCUIGGhJIQRFYaZ6JW4OMe+QEqckrWTaek1GPI65O//XNd uiR2lJbRVC9KGLX9ElG5ynJi+e8nby26cRhzeBKoCtHtd5cLJjPQ0sfACNyD/ahlZ4DW+r6bUwSHp qQuQjuV/lnENDhWbswCE8A==; In-Reply-To: <871qfxvvw9.fsf@breatheoutbreathe.in> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268082 Archived-At: > Cc: jonas@bernoul.li > Date: Sun, 20 Aug 2023 21:06:54 -0700 > From: Joseph Turner via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > Functions which are added to save-some-buffers-functions are always > called when save-some-buffers runs, even when a PRED argument is > specified. This leads to unexpected behavior when PRED is intended to > limit saving buffers to a specific set of file buffers, as in Magit's > magit-save-repository-buffers function. > > abbrev--possibly-save is added to save-some-buffers-functions by default > now, so whenever magit-save-repository-buffers runs, Emacs prompts to > save unsaved abbrevs (as well any other functions in the list). Why is asking whether to save the abbrevs a problem in the case of magit-save-repository-buffers? And are you saying that before the change which added save-some-buffers-functions, Emacs was not saving the abbrevs when save-some-buffers was called? If so, in what Emacs version was this so? > I propose that we pass along the PRED argument of save-some-buffers to > each of save-some-buffers-functions, allowing them to determine what is > appropriate to do. Alternatively, we could pass along the return value > of files--buffers-needing-to-be-saved, which is a list of buffers. We need a better understanding of the situation before we can discuss solutions, so please fill-in the blanks outlined above. (The solution you propose is not very backward-compatible, so probably not acceptable anyway, as Emacs 29 was already released with the current code. But let's defer this discussion until the issue is more clear.)