From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Date: Fri, 25 Aug 2023 23:38:18 -0700 Message-ID: <87fs46cn6u.fsf@breatheoutbreathe.in> References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> Reply-To: Joseph Turner Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2036"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jonas@bernoul.li, 65414@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 26 08:51:23 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 1qZn8k-0000LY-Ug for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Aug 2023 08:51:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZn8R-0000rr-H8; Sat, 26 Aug 2023 02:51:03 -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 1qZn8L-0000rb-RJ for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 02:50:57 -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 1qZn8L-0000Tz-A8 for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 02:50:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZn8Q-0002Al-5j for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 02:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joseph Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Aug 2023 06:51: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.16930326158294 (code B ref 65414); Sat, 26 Aug 2023 06:51:02 +0000 Original-Received: (at 65414) by debbugs.gnu.org; 26 Aug 2023 06:50:15 +0000 Original-Received: from localhost ([127.0.0.1]:41588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZn7e-00029i-SE for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:50:15 -0400 Original-Received: from out-252.mta1.migadu.com ([95.215.58.252]:10725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZn7b-00029W-1K for 65414@debbugs.gnu.org; Sat, 26 Aug 2023 02:50:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1693032604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mnogWCHt1FkFMc1zhVfhJJ94HDx1RUGcYpgywyGFbMs=; b=hQjWWQeG4ZsL5JJHOR89j0puluMfIRGiAN9Z2Jx7EEqGPysR/m7IRKEeD53BPTxkE3/+6u ef4sJCfU7wz65n3x5u6ylTjK/MtAf0SzgmxjplryqtFImu1zkAZLY9zDAoCi2UxAQzpuuC rK8pa+7Wrjb6iLafcC0yw1RQZy89RtA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <83o7ixqatx.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT 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:268471 Archived-At: Eli Zaretskii writes: >> From: Joseph Turner >> Cc: 65414@debbugs.gnu.org, jonas@bernoul.li >> Date: Wed, 23 Aug 2023 16:57:06 -0700 >> >> 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. This problem is not new. However, now that save-some-buffers-functions has been added, the problem goes beyond abbrevs. >> 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 think magit-save-repository-buffers follows the common protocol correctly. > 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"? The issue is not that save-some-buffers prompts instead of saving without questions. What is undesirable to me is that save-some-buffers unconditionally calls each one of save-some-buffers-functions, regardless of PRED. This means that when save-some-buffers is used with the intention to save only a handful of files (as with magit-save-repository-buffers), save-some-buffers-functions are all called, even when irrelevant. Thanks again for your patience :) Joseph