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: Thu, 24 Aug 2023 08:16:26 +0300 Message-ID: <83o7ixqatx.fsf@gnu.org> References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36600"; 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 Thu Aug 24 07:17:19 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 1qZ2id-0009I9-1o for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 07:17:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ2iL-000175-8V; Thu, 24 Aug 2023 01:17:02 -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 1qZ2iI-00015Z-UY for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 01:16:58 -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 1qZ2iI-0001gS-Ln for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 01:16:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZ2iM-0006O9-CO for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 01:17: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: Thu, 24 Aug 2023 05:17: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.169285418024506 (code B ref 65414); Thu, 24 Aug 2023 05:17:02 +0000 Original-Received: (at 65414) by debbugs.gnu.org; 24 Aug 2023 05:16:20 +0000 Original-Received: from localhost ([127.0.0.1]:35887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ2hg-0006NA-64 for submit@debbugs.gnu.org; Thu, 24 Aug 2023 01:16:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ2ha-0006Mm-Pe for 65414@debbugs.gnu.org; Thu, 24 Aug 2023 01:16:18 -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 1qZ2hP-0001cT-GG; Thu, 24 Aug 2023 01:16:03 -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=y1nT3BQeoN6wmPfOITylbhPilvwHw1qoT8qeJczDjTs=; b=ag2eGEp7iJ+H 16C/FKZAWB9rgO8BkCc+BQoh136PWtWxGECvQUEmrnLIVRBtVfMnCIrP/YaRyMhEBq1sGaMBU22df yahcKJCBVzP9eZwrxwVGNK4n23mBSqUC+b5gatUtkPZ0fOTuZzq9OhGQyCzy+ARmd7m74Gnlgyfup 7RFsTXIyxlyDQpgdeGqBjazYpPJKbqeD/aearU3PndY8Cp4OShSZPiZKw2cYGu0UP4cRGn+k2v/tb tZON4r/HJ/YF1uXm/O/Cg2cMthvxS+XovD2NjAYBF/ytKVrDaQpnKiLZqbqUUvj7z3uZBXwtpKQRk CEP6W20EktVwQy0yUSZAOQ==; In-Reply-To: <87o7ixe1e2.fsf@breatheoutbreathe.in> (message from Joseph Turner on Wed, 23 Aug 2023 16:57:06 -0700) 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:268297 Archived-At: > From: Joseph Turner > Cc: 65414@debbugs.gnu.org, jonas@bernoul.li > Date: Wed, 23 Aug 2023 16:57:06 -0700 > > > Eli Zaretskii writes: > > > Why is asking whether to save the abbrevs a problem in the case of > > magit-save-repository-buffers? > > magit-save-repository-buffers docstring reads "Save file-visiting > buffers belonging to the current repository." IIUC, prompting to save > abbrevs here is an undesirable implementation side-effect. Why is it undesirable? save-some-buffers always saved abbrevs, didn't it? And it did so independently of PRED, right? So how did this problem suddenly started affecting Magit? IOW, I still don't have a clear idea what caused this problem, if (AFAIU) it is a problem that started happening recently. > Another example: hyperdrive.el adds to save-some-buffers-functions for > saving hyperdrive file buffers: > > https://git.sr.ht/~ushin/hyperdrive.el/tree/d7dc7a08ba47761108cf98e21ffa2d8dad28f34a/item/hyperdrive.el#L99 > > After this change, magit-save-repository-buffers now prompts to save > irrelevant hyperdrive file buffers. I would like some way to tell > hyperdrive--save-some-buffers not to prompt the user to save hyperdrive > buffers from inside magit-save-repository-buffers. Why do you want to do that? Whether or not to prompt the user abides by the common protocol defined by save-some-buffers: if it's called with the argument ARG non-nil (which should happen interactively when the user invokes the command with a prefix argument), there's no prompt, otherwise Emacs prompts. Why magit-save-repository-buffers wants to break this common protocol? I feel that I'm still missing something important, which causes you to want a different behavior from magit-save-repository-buffers. For starters, can you describe how magit-save-repository-buffers ends up calling save-some-buffers-functions in enough detail for me to understand why you think saving these buffers is deemed "undesirable"? > > 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? > > The behavior of saving abbrevs when a PRED function is passed to > save-some-buffers has not changed in Emacs 29. I just think that there > may be room for improvement now that save-some-buffers-functions allows > any package to add to save-some-buffers-functions. We could try thinking about some backward-compatible change to the save-some-buffers-functions feature, but a better understanding of the issue is still needed. Thanks.