From unknown Sun Aug 10 16:50:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65414 <65414@debbugs.gnu.org> To: bug#65414 <65414@debbugs.gnu.org> Subject: Status: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Reply-To: bug#65414 <65414@debbugs.gnu.org> Date: Sun, 10 Aug 2025 23:50:40 +0000 retitle 65414 save-some-buffers-functions are unexpectedly called when save= -some-buffers pred is non-nil reassign 65414 emacs submitter 65414 Joseph Turner severity 65414 normal tag 65414 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 00:53:51 2023 Received: (at submit) by debbugs.gnu.org; 21 Aug 2023 04:53:51 +0000 Received: from localhost ([127.0.0.1]:55189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXwvG-0005JB-Vz for submit@debbugs.gnu.org; Mon, 21 Aug 2023 00:53:51 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXwvE-0005Iy-R3 for submit@debbugs.gnu.org; Mon, 21 Aug 2023 00:53:49 -0400 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 1qXwv7-00037h-I4 for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 00:53:41 -0400 Received: from out-55.mta0.migadu.com ([2001:41d0:1004:224b::37]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXwv4-0006Xn-Dn for bug-gnu-emacs@gnu.org; Mon, 21 Aug 2023 00:53:41 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1692593610; 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; bh=RFlY/Br+RkmnjufxzdnpAyYNXVq10TskAplvfLjIdGU=; b=a+yJkCb3eZYTrfdxMv1wD2xvcFRoFA4mjQu9D/4v6yQrTuGnHcK8B6PeWDScZ9174DdTDp WbA29PBtqtQIYA6V45qM6vOG1tpPrcuiw+HAtMIDxZowXqSY0UD9XoSkk069yMejAjHG2/ /mGbe+UaB0JeXUrKiXP01XW6DxwrrgY= From: Joseph Turner To: bug-gnu-emacs@gnu.org Subject: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Date: Sun, 20 Aug 2023 21:06:54 -0700 Message-ID: <871qfxvvw9.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::37; envelope-from=joseph@breatheoutbreathe.in; helo=out-55.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: jonas@bernoul.li X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 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). 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. Thoughts? Joseph From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 21 07:56:55 2023 Received: (at 65414) by debbugs.gnu.org; 21 Aug 2023 11:56:55 +0000 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 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 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==; Date: Mon, 21 Aug 2023 14:56:59 +0300 Message-Id: <83lee4vcac.fsf@gnu.org> From: Eli Zaretskii To: Joseph Turner In-Reply-To: <871qfxvvw9.fsf@breatheoutbreathe.in> (bug-gnu-emacs@gnu.org) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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.) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 20:21:24 2023 Received: (at 65414) by debbugs.gnu.org; 24 Aug 2023 00:21:24 +0000 Received: from localhost ([127.0.0.1]:35649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYy6F-00040v-0b for submit@debbugs.gnu.org; Wed, 23 Aug 2023 20:21:24 -0400 Received: from out-43.mta1.migadu.com ([95.215.58.43]:18230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYy69-00040j-7P for 65414@debbugs.gnu.org; Wed, 23 Aug 2023 20:21:21 -0400 References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1692836472; 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=GlC3DpZajWYEbgHiqpqDaMLyvdkI+f+eB7UASiPE5zI=; b=H/kQeFwu+ulGpBIswywDzdvt3pkI1SOlc7JPlqZdA7zOoNUvjyArRANMQGkncwRFAJzAlE PpkCmW+kYpJM6/WATIrIVsdnv3ZyoDZOlRCcZT/qVQFQbwIGXKdHRWf3MTVpWAkFbWpBch SWlCu0i40AhYNYQZsN2C+60+QQn8JOU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Eli Zaretskii Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Date: Wed, 23 Aug 2023 16:57:06 -0700 In-reply-to: <83lee4vcac.fsf@gnu.org> Message-ID: <87o7ixe1e2.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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. 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. > 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 need a better understanding of the situation before we can discuss > solutions, so please fill-in the blanks outlined above. I hope the explanation above is clear. Sorry for starting off on the wrong foot with an XY problem! Thank you! Joseph From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 24 01:16:20 2023 Received: (at 65414) by debbugs.gnu.org; 24 Aug 2023 05:16:20 +0000 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 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 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==; Date: Thu, 24 Aug 2023 08:16:26 +0300 Message-Id: <83o7ixqatx.fsf@gnu.org> From: Eli Zaretskii To: Joseph Turner In-Reply-To: <87o7ixe1e2.fsf@breatheoutbreathe.in> (message from Joseph Turner on Wed, 23 Aug 2023 16:57:06 -0700) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 02:50:15 2023 Received: (at 65414) by debbugs.gnu.org; 26 Aug 2023 06:50:15 +0000 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 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 References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> 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. From: Joseph Turner To: Eli Zaretskii Subject: Re: 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 In-reply-to: <83o7ixqatx.fsf@gnu.org> Message-ID: <87fs46cn6u.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 03:26:22 2023 Received: (at 65414) by debbugs.gnu.org; 26 Aug 2023 07:26:22 +0000 Received: from localhost ([127.0.0.1]:41632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZngc-00032p-59 for submit@debbugs.gnu.org; Sat, 26 Aug 2023 03:26:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZngW-00032a-RV for 65414@debbugs.gnu.org; Sat, 26 Aug 2023 03:26:20 -0400 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 1qZngI-0007Lc-Ag; Sat, 26 Aug 2023 03:26:02 -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=v8NceejLzNhwsKQuY8pY/bK1MVm5DsUFnsM8SDI0nLE=; b=e30/3Q6vBB15 pOx2TSDeByoutybgY+sGyLoRLmqd9HRAfBAehSePDbn0LW3WMmfinspwdQkh3iOcxK5cGvF2P4brM LO3ltlHqmMdxt59t5G9hI9544o9YwBUWbgfuFkXPUI67psdmMDwfDTtq5PqkJe2ocmB5kdYv5zBxc sJX4/8C3w/U+kVYqZ0fM4aHAt5cyEmHbxD91guleeYCPAXIQ34uHRxnMBe+XFxR9q+rgC9KWZZTwN 5vb++ux2g0FNQmTNQ6pXj68ylYJqzN1+bbzvorJZCtgmFn2+E0HFm8HUrfg8WuKxy+e8rkHCjk8Fm dNTzp4OncXlXtzzYdI9ycg==; Date: Sat, 26 Aug 2023 10:26:30 +0300 Message-Id: <838r9ymfh5.fsf@gnu.org> From: Eli Zaretskii To: Joseph Turner In-Reply-To: <87fs46cn6u.fsf@breatheoutbreathe.in> (message from Joseph Turner on Fri, 25 Aug 2023 23:38:18 -0700) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Joseph Turner > Cc: 65414@debbugs.gnu.org, jonas@bernoul.li > Date: Fri, 25 Aug 2023 23:38:18 -0700 > > > Eli Zaretskii writes: > > > 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. So your problem is with Lisp programs that add functions to save-some-buffers-functions, but don't expect or don't want those functions to be called each time save-some-buffers is invoked? I'm not sure how did those Lisp programs get the idea that save-some-buffers-functions will not be called always -- is it hinted by some documentation somewhere? If not, I'd say that those Lisp programs have a bug that needs to be fixed in those programs. Right? In any case, not calling save-some-buffers-functions when PRED is non-nil is not something we can do, as that would be an incompatible behavior change. We could perhaps add PRED to the arguments with which save-some-buffers-functions are called, as an optional argument. Would that be satisfactory? From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 03:53:27 2023 Received: (at 65414) by debbugs.gnu.org; 26 Aug 2023 07:53:27 +0000 Received: from localhost ([127.0.0.1]:41668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZo6o-0003ns-PG for submit@debbugs.gnu.org; Sat, 26 Aug 2023 03:53:27 -0400 Received: from out-247.mta1.migadu.com ([95.215.58.247]:62839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZo6l-0003ne-CC for 65414@debbugs.gnu.org; Sat, 26 Aug 2023 03:53:25 -0400 References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1693036396; 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=KbS91jLttEdsJovAi+Cy6YesCiY/DvRR/m9LEhbRrnQ=; b=HP9QkNihWw3icLXhDbcRTzAm6VeAIxvCc3vUhLu0CtdB/Gg4QUwzbQdISCn99OfA8uUhja h0DmFNvBY+fItmrhfpaWzRMUIVCDOvnMkA2CAXwS3W5hz50h7OL2kZsLI6EX0hRWTHvL2w Oa+vDnjlxVXsuBGNNTt1bMf4VqKtvSA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Eli Zaretskii Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Date: Sat, 26 Aug 2023 00:32:23 -0700 In-reply-to: <838r9ymfh5.fsf@gnu.org> Message-ID: <874jkmck9j.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > So your problem is with Lisp programs that add functions to > save-some-buffers-functions, but don't expect or don't want those > functions to be called each time save-some-buffers is invoked? Yes. > I'm not sure how did those Lisp programs get the idea that > save-some-buffers-functions will not be called always -- is it hinted > by some documentation somewhere? If not, I'd say that those Lisp > programs have a bug that needs to be fixed in those programs. Right? I agree. > In any case, not calling save-some-buffers-functions when PRED is > non-nil is not something we can do, as that would be an incompatible > behavior change. We could perhaps add PRED to the arguments with > which save-some-buffers-functions are called, as an optional argument. > Would that be satisfactory? Yes, that would solve the interference between Magit and hyperdrive.el. See patch. Thank you! Joseph --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Pass-PRED-to-each-of-save-some-buffers-functions.patch >From 28e8745b579da5f83afc7f9eb5b5ed2df2f3204e Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Sat, 26 Aug 2023 00:50:28 -0700 Subject: [PATCH] Pass PRED to each of save-some-buffers-functions * lisp/abbrev.el (abbrev--possibly-save): Ignore PRED * lisp/files.el (save-some-buffers-functions): Fix documentation (save-some-buffers): Pass PRED to each of save-some-buffers-functions --- lisp/abbrev.el | 2 +- lisp/files.el | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/abbrev.el b/lisp/abbrev.el index e1311dbc83b..43e7c7e5e5d 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -1242,7 +1242,7 @@ which see." '(edit-abbrevs-mode-font-lock-keywords nil nil ((?_ . "w")))) (setq font-lock-multiline nil)) -(defun abbrev--possibly-save (query &optional arg) +(defun abbrev--possibly-save (query &optional arg _pred) ;; Query mode. (if (eq query 'query) (and save-abbrevs abbrevs-changed) diff --git a/lisp/files.el b/lisp/files.el index 29d109ab385..6ab10cc3310 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6003,8 +6003,8 @@ function should return non-nil if there is something to be saved (but it should not actually save anything). If the first argument is something else, then the function should -save according to the value of the second argument, which is the -ARG argument from `save-some-buffers'.") +save according to the values of the second and third arguments, +which are the ARG and PRED arguments from `save-some-buffers'.") (defun save-some-buffers (&optional arg pred) "Save some modified file-visiting buffers. Asks user about each one. @@ -6099,7 +6099,7 @@ after saving the buffers." save-some-buffers-action-alist)) ;; Allow other things to be saved at this time, like abbrevs. (dolist (func save-some-buffers-functions) - (setq inhibit-message (or (funcall func nil arg) inhibit-message))) + (setq inhibit-message (or (funcall func nil arg pred) inhibit-message))) (or queried (> files-done 0) inhibit-message (cond ((null autosaved-buffers) -- 2.41.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 07:58:24 2023 Received: (at control) by debbugs.gnu.org; 26 Aug 2023 11:58:24 +0000 Received: from localhost ([127.0.0.1]:41817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZrvs-0002DC-9u for submit@debbugs.gnu.org; Sat, 26 Aug 2023 07:58:24 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:57711) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZrvq-0002Cx-GH for control@debbugs.gnu.org; Sat, 26 Aug 2023 07:58:23 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5009969be25so2789799e87.3 for ; Sat, 26 Aug 2023 04:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693051091; x=1693655891; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=N88wcYyGduRPE788UfA3qIRqCHDafDEkqzeGUG/auzc=; b=os0UrJBTuBDn6yeftTkgxPKiuizcDsvwTZykZse/JgcfMv1DsfPy2MlD91d5rTKp13 H4uPumRIj8yHF2Q/XmpRWKi9jpyRjSMz5+xXCMZirQx3In9QES4tpwxA1M+ahhir7CI+ lwLqpE9Y1nD6X7wJe32ibxfyJv7Z5VyywallayNM7dMSNLUdAfJSTIKGWh7jY/kiTjIC VwKIrMnQahSSB0cLSUnQPl3lmhVX+7Niqlx8hdiG7WC/eLuYL5qMH5GhYiltETMlVWeP cODC3SYZaHZ2IVtpJgTeQ31LgpV4XPHYAhwcEwc8b8qswRitBKP1fWtslhpnndld3qMB vhAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693051091; x=1693655891; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=N88wcYyGduRPE788UfA3qIRqCHDafDEkqzeGUG/auzc=; b=Ey5bvxY3u8Snqez3E6Auf3StVVWoYiXUTS540yO9OIxWhbCBXzwNXkrs3oHyDp33iw rWVvkfwp+3aQpU/o1slerQEKtudK+mnHtJu5XeriRUDz/1JVfksrD+smKYbebSQJ94ZW a4qnlpooTTqhUfp3A4KFcny/52XhVJEFYwTRlfz4L35YJXh+GzHCoFmRuP5aUL4hjdBv mePRBbHjmvM6BhToJI8qC4TVMWwNhDYSZfD4mnS8k9X8kwkGOmFh64ZBwcVBMfheE/bT 7H68Mz/vzjUj6uPv+y4X6DpSoBWiVabWKrWZvwwv/TVNSEtLuWRgWAjJl8XIAbCGTh9c mUcg== X-Gm-Message-State: AOJu0YxZuxkDgqU4JNQW0/nd7GpJ8taYiKDVtg7wjMgHDgqOb7bPAq0p kX5TFjDqWs1H9ufx5F6IjHCALmqNV1EvqLGc/nFrZywR3wc= X-Google-Smtp-Source: AGHT+IEq4gY4DyYnpLM76NiVKmwYsdkMwpb1D4uYXyaAlFBPfkCPS4tx1ATr/0XVcMc5laUp4OOJl/Dbkl1mpuG6Acg= X-Received: by 2002:ac2:4dba:0:b0:4f8:bfb4:e4c4 with SMTP id h26-20020ac24dba000000b004f8bfb4e4c4mr13528312lfe.19.1693051091375; Sat, 26 Aug 2023 04:58:11 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas Date: Sat, 26 Aug 2023 13:57:59 +0200 Message-ID: Subject: To: control Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 65414 + patch thanks Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:134 listed in] [list.dnswl.org] 2.0 BLANK_SUBJECT Subject is present but empty X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 65414 + patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 02 03:31:08 2023 Received: (at 65414) by debbugs.gnu.org; 2 Sep 2023 07:31:08 +0000 Received: from localhost ([127.0.0.1]:35024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcL63-0003ff-VD for submit@debbugs.gnu.org; Sat, 02 Sep 2023 03:31:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcL61-0003fB-KP for 65414@debbugs.gnu.org; Sat, 02 Sep 2023 03:31:06 -0400 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 1qcL5k-0004WE-9H; Sat, 02 Sep 2023 03:30:48 -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=zslxKGVprw2xM2qPn6jMxNveZo3ToguZXSNrEK4sw0w=; b=FJOtxxTPdMeO gtR9MYxZZ8QMdiUhXh8oJ8+yIOSagTM3TY7sYKfF94ZRnIhfctGzwj+4n/ENCqmbcqW7GrAT7tXEo qsx0AlKPbL5zUtypZ6OvYYtRB32ITAWbS1dP6jGQUC4NPcwIRZI/axLH4KgzTct8YW22egTLdTQXK eOtTxpVOKzfvLgJsQlhRBu5G4wXJjiMElg6UkeuvYt/YlmPQuHLc1MFMh6+gKRJiU802aTo5TJg7f qSayXUWH0rLhUg3hlmZpHT1muBE7lS04rGeA4mmA3akYozJlZ7kGOeQbrtkOe7GvHx1mc3rwUoAgJ UmmzSNl+F068NpMLC0Iaag==; Date: Sat, 02 Sep 2023 10:30:31 +0300 Message-Id: <83v8ct9gmg.fsf@gnu.org> From: Eli Zaretskii To: Joseph Turner , Stefan Monnier In-Reply-To: <874jkmck9j.fsf@breatheoutbreathe.in> (message from Joseph Turner on Sat, 26 Aug 2023 00:32:23 -0700) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Joseph Turner > Cc: 65414@debbugs.gnu.org, jonas@bernoul.li > Date: Sat, 26 Aug 2023 00:32:23 -0700 > > > > In any case, not calling save-some-buffers-functions when PRED is > > non-nil is not something we can do, as that would be an incompatible > > behavior change. We could perhaps add PRED to the arguments with > > which save-some-buffers-functions are called, as an optional argument. > > Would that be satisfactory? > > Yes, that would solve the interference between Magit and hyperdrive.el. > > See patch. Hmm... but how to make this change backward-compatible? I mean, if there's some function out there that is used in save-some-buffers-functions, and it was written to accept only 2 arguments, we cannot safely call it with 3 arguments, can we? Stefan, do we have any way of doing that without causing errors? If not, perhaps the way forward is to bind some variable around the call to these functions, whose value will be PRED? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 13:16:32 2023 Received: (at 65414) by debbugs.gnu.org; 3 Sep 2023 17:16:32 +0000 Received: from localhost ([127.0.0.1]:46738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcqi7-0000Qn-VC for submit@debbugs.gnu.org; Sun, 03 Sep 2023 13:16:32 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcqi5-0000QZ-4w for 65414@debbugs.gnu.org; Sun, 03 Sep 2023 13:16:29 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 11845100068; Sun, 3 Sep 2023 13:06:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1693760775; bh=w1mS7Dihp6l4c3a4KeyXSV9QF7XiE5cZTOqgrUJR0rA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=h3XcGwqTSh7eq3TDP2mKCWotdPTf80wsA9yD8N56ip1T4orBYu+uK8xIeTXMbh5o4 xLryV/nnUm1Mo2y0ErHCYsG4xDudCFKLvnStav6xq+RhuWA+TqfhuSSm260QqPoTx/ 1jlF5loe20VXZ37FRzRLAO7PBYqbL9h8ASzPLzm9f1v+M29EIHb6j9ir2ixsnkKNlR L4ZoRmhtRNnbLmU0OWJiLBBQm0mHiL52mYCQARHZIFSEJY+ehRu3qPszZQEWe3Is9h F7Ke2Gcj7A7Fmdk8kR/89pAHLdO+I5plAQovcRpsieeNIKU7euJxTFG7w7jhQwyxE9 bnw2l0x5yyA0w== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 02A22100046; Sun, 3 Sep 2023 13:06:15 -0400 (EDT) Received: from pastel (104-222-114-42.cpe.teksavvy.com [104.222.114.42]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B528B12022A; Sun, 3 Sep 2023 13:06:14 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil In-Reply-To: <83v8ct9gmg.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Sep 2023 10:30:31 +0300") Message-ID: References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> Date: Sun, 03 Sep 2023 13:06:07 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.125 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org, Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> > In any case, not calling save-some-buffers-functions when PRED is >> > non-nil is not something we can do, as that would be an incompatible >> > behavior change. We could perhaps add PRED to the arguments with >> > which save-some-buffers-functions are called, as an optional argument. >> > Would that be satisfactory? >> Yes, that would solve the interference between Magit and hyperdrive.el. >> See patch. [ Sorry, `debbugs.gnu.org` appears to be down, so I couldn't read the whole bug report, so I haven't seen the patch among other things. Hopefully that doesn't invalidate my comment :-) ] > Hmm... but how to make this change backward-compatible? I mean, if > there's some function out there that is used in > save-some-buffers-functions, and it was written to accept only 2 > arguments, we cannot safely call it with 3 arguments, can we? AFAICT `save-some-buffers-functions` is brand new in Emacs-29.1 and currently gets called sometimes with 1 and sometimes with 2 arguments (that's a somewhat unusual API in this respect), so it's probably OK to break backward compatibility because it will only affect fresh code that can easily be adjusted. [ Arguably, it would be even better to arrange for `hyperdrive.el` to save its buffers "in the usual way", i.e. relying on `buffer-offer-save`, `save-buffer`, `buffer-save-without-query, ... ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 13:29:29 2023 Received: (at 65414) by debbugs.gnu.org; 3 Sep 2023 17:29:29 +0000 Received: from localhost ([127.0.0.1]:46776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcquf-0000l0-AL for submit@debbugs.gnu.org; Sun, 03 Sep 2023 13:29:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcquc-0000km-SO for 65414@debbugs.gnu.org; Sun, 03 Sep 2023 13:29:27 -0400 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 1qcquW-0005jK-IP; Sun, 03 Sep 2023 13:29:20 -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=mmN2ouKzfLbzrr9CFu3WxznvfLpUX59BunX5QakrwJw=; b=NHsEy0Wp6i9B vAvaiHFEl3xVqTpICKc0E3ojIqtSskL/XWS4eCOuCicGbNavoCI6UooHibuuqyQKf9wxQkmlT4/Ja +fhZxvSaxtqtwdxwaZh+odEGHdAl4WV2L1JgZG1BNb2pspSuaKWcfja/TaGW5bRZSAGuYRN7FsxbU lSTdRMOyWJxmXonETESQVSw3QqGnMS5y1xhQvtjY1HjpvlhOqDYPexwySCo60/DVyg2m9Md8OFPQb k5B4KA1KAwr8ftGIRrmkERmV3nKHh+O1/w1fHogcd/Gen7FQpSytJtCbZeF6XKf0Lq0A2KSd40NUg neaRkXNUmhYg3HnIY85IYg==; Date: Sun, 03 Sep 2023 20:29:00 +0300 Message-Id: <8334zv6u8z.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sun, 03 Sep 2023 13:06:07 -0400) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, 65414@debbugs.gnu.org, joseph@breatheoutbreathe.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: Joseph Turner , 65414@debbugs.gnu.org, > jonas@bernoul.li > Date: Sun, 03 Sep 2023 13:06:07 -0400 > > Sorry, `debbugs.gnu.org` appears to be down It is back up. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 13:35:30 2023 Received: (at 65414) by debbugs.gnu.org; 3 Sep 2023 17:35:30 +0000 Received: from localhost ([127.0.0.1]:46798 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcr0U-0000wC-1m for submit@debbugs.gnu.org; Sun, 03 Sep 2023 13:35:30 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:40029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcr0Q-0000vI-Et for 65414@debbugs.gnu.org; Sun, 03 Sep 2023 13:35:26 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 031EFC0007; Sun, 3 Sep 2023 17:35:18 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil In-Reply-To: <83v8ct9gmg.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Sep 2023 10:30:31 +0300") Organization: LINKOV.NET References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> Date: Sun, 03 Sep 2023 20:22:56 +0300 Message-ID: <86bkej18pz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65414 Cc: 65414@debbugs.gnu.org, jonas@bernoul.li, Stefan Monnier , Joseph Turner X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> > In any case, not calling save-some-buffers-functions when PRED is >> > non-nil is not something we can do, as that would be an incompatible >> > behavior change. We could perhaps add PRED to the arguments with >> > which save-some-buffers-functions are called, as an optional argument. >> > Would that be satisfactory? >> >> Yes, that would solve the interference between Magit and hyperdrive.el. >> >> See patch. > > Hmm... but how to make this change backward-compatible? I mean, if > there's some function out there that is used in > save-some-buffers-functions, and it was written to accept only 2 > arguments, we cannot safely call it with 3 arguments, can we? If nothing else helps, just catch 'wrong-number-of-arguments', then call with an obsolete signature again. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 13:45:18 2023 Received: (at 65414) by debbugs.gnu.org; 3 Sep 2023 17:45:18 +0000 Received: from localhost ([127.0.0.1]:46826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcr9x-00025n-M1 for submit@debbugs.gnu.org; Sun, 03 Sep 2023 13:45:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcr9u-0001dq-MB for 65414@debbugs.gnu.org; Sun, 03 Sep 2023 13:45:16 -0400 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 1qcr9n-0002sS-H2; Sun, 03 Sep 2023 13:45:07 -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=jjFcQqOros6MFdpuCbmjL4N4Gp1X+us+jxPONCeAa1E=; b=Gd9RnHgDa8l8 vZO0C5IHK8Gs2yKNhQqUIIxWcwCx9DYjG/HAvCbVvD96kXcyH1U3OyQhl+iqouhv1RHqQgE+MhHRD no87DfEPPLQfapnSRTE9dZqtBDMXdvcQeujhTlRDkoVLaW/5AYXRCTqyo8ydaxdIR++kQ6NCNVYfO fm2CVy6u0rRB8VoU1KC8KkZ6gl51iZMBtphWpl143fYhsGUVGyu2OGAmNJm9H+IDb1Cm37Kwxv/+2 jFhQb/sKr0QcLNvIhoOvIRYlaGFsH7sp5MVnJM0EG15CXhm3Xc02U+dbTvu5ls5cptADFnbjIHTHa lRvKVM157X4/SZGeu5TgPA==; Date: Sun, 03 Sep 2023 20:44:45 +0300 Message-Id: <831qff6tiq.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov In-Reply-To: <86bkej18pz.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 03 Sep 2023 20:22:56 +0300) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> <86bkej18pz.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: 65414@debbugs.gnu.org, jonas@bernoul.li, monnier@iro.umontreal.ca, joseph@breatheoutbreathe.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Juri Linkov > Cc: Joseph Turner , Stefan Monnier > , jonas@bernoul.li, 65414@debbugs.gnu.org > Date: Sun, 03 Sep 2023 20:22:56 +0300 > > > Hmm... but how to make this change backward-compatible? I mean, if > > there's some function out there that is used in > > save-some-buffers-functions, and it was written to accept only 2 > > arguments, we cannot safely call it with 3 arguments, can we? > > If nothing else helps, just catch 'wrong-number-of-arguments', > then call with an obsolete signature again. I was hoping for a cleaner, more elegant solution. Still do. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 14:31:27 2023 Received: (at 65414) by debbugs.gnu.org; 3 Sep 2023 18:31:27 +0000 Received: from localhost ([127.0.0.1]:46899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcrsd-0001vI-Fw for submit@debbugs.gnu.org; Sun, 03 Sep 2023 14:31:27 -0400 Received: from out-226.mta0.migadu.com ([91.218.175.226]:47707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcrsY-0001v6-5J for 65414@debbugs.gnu.org; Sun, 03 Sep 2023 14:31:26 -0400 References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1693765880; 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=vmXA6EzrTcDLpsVQRNq7GKoPD5gwr2GFs2CXi7CF0Ac=; b=NP/mKpD8jcF9+0deFkjBpgqe0AYnnMtpYnGxrU4NvxnxSLAxBBkdUaWdHqXBNOmAKt0+AT ByKXw4d3cayhVSJJ3RMI5F+cpzATjljUh7+XdO9stP6l/enq/xRJ57nWFXomzb+B+Mbjz2 dzx+7CIzxOzrgPCcx8qWNHvoxFvjD3c= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Stefan Monnier Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Date: Sun, 03 Sep 2023 10:52:39 -0700 In-reply-to: Message-ID: <87bkejnm6i.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65414 Cc: Eli Zaretskii , jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > [ Arguably, it would be even better to arrange for `hyperdrive.el` to > save its buffers "in the usual way", i.e. relying on > `buffer-offer-save`, `save-buffer`, `buffer-save-without-query, ... ] I was not aware of `buffer-offer-save`. Thank you for the suggestion! Since we already rely on `save-buffer`, setting `buffer-offer-save` to t is much simpler than adding to `save-some-buffers-functions`. It also resolves the interference between Magit and hyperdrive.el. However... I wonder what the intended purpose of `save-some-buffers-functions` is if packages like `hyperdrive.el` are intended to use `buffer-offer-save`? Joseph From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 15:03:36 2023 Received: (at 65414) by debbugs.gnu.org; 3 Sep 2023 19:03:36 +0000 Received: from localhost ([127.0.0.1]:46941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcsNj-0005OO-Ok for submit@debbugs.gnu.org; Sun, 03 Sep 2023 15:03:36 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4907) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcsNh-0005O0-Of for 65414@debbugs.gnu.org; Sun, 03 Sep 2023 15:03:34 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8D562100068; Sun, 3 Sep 2023 15:03:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1693767807; bh=natnJO9Qb1i25SZnf+ZtodYb49D+T/XXnkA3pb/MsUM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ZLD4S0HzSZenDd2lLyn+Bt5/+mvS4BaN0ekhM4Ev0vFfCrnUOJV//5E4uLOC0vmc9 CC4mvVwCytNWhXTO67YGzpKBcFGVls4nhtlTcX9N5WpfiOATlbYp0qLiwzjw5ly+QK d1x9G7JGWZdKKi3NvyAuluGSaAK+zTT00hn03JB/9vsxVfYe5qeNBdE1tkf1x0wvSl BxjDea/AW6oxvr/un1yPLWgfKDts7FTMHtoSzbmDUN6GsOzgKLuRDLB98PlEKHShNm i/P2xo9h9uutE2eWAY8w3Ar65hZtrdc+9dyPW0Tmc7E10VNJotliA8T3VZc2/lPmTf jY/qolXFTF14Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 84F47100046; Sun, 3 Sep 2023 15:03:27 -0400 (EDT) Received: from pastel (69-165-136-223.dsl.teksavvy.com [69.165.136.223]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 583111202B6; Sun, 3 Sep 2023 15:03:27 -0400 (EDT) From: Stefan Monnier To: Joseph Turner Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil In-Reply-To: <87bkejnm6i.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Sun, 03 Sep 2023 10:52:39 -0700") Message-ID: References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> <87bkejnm6i.fsf@breatheoutbreathe.in> Date: Sun, 03 Sep 2023 15:03:25 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.126 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: Eli Zaretskii , jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > However... I wonder what the intended purpose of > `save-some-buffers-functions` is if packages like `hyperdrive.el` are > intended to use `buffer-offer-save`? IIUC the purpose is to save things that are kept in variables rather than buffers. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 03 15:05:18 2023 Received: (at 65414) by debbugs.gnu.org; 3 Sep 2023 19:05:18 +0000 Received: from localhost ([127.0.0.1]:46945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcsPO-0005R3-6d for submit@debbugs.gnu.org; Sun, 03 Sep 2023 15:05:18 -0400 Received: from out-222.mta0.migadu.com ([91.218.175.222]:32291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcsPL-0005Qt-0y for 65414@debbugs.gnu.org; Sun, 03 Sep 2023 15:05:16 -0400 References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> <87bkejnm6i.fsf@breatheoutbreathe.in> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1693767914; 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=q8ENrceBqBqJozBSADGrLWySAgJdMfSVnOlun3ZKT1A=; b=ILwrQe3Rr3lRdfIR+AAIUBf+0lio/0PLkoTOcgVaTmE+uTUVTMFiXSFw9oYLPLiK6AN+99 f2XWB8AreyYsVTiwlxprCZneO5sVZSzkl1uD+DjTZGUXs7e3pjIcEJYK+vhnzf3PYtLE/M aqGxKkjTl4XiFCjSxZjiOeJVUHBLgMM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Stefan Monnier Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Date: Sun, 03 Sep 2023 12:04:54 -0700 In-reply-to: Message-ID: <87msy3m61m.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65414 Cc: Eli Zaretskii , jonas@bernoul.li, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> However... I wonder what the intended purpose of >> `save-some-buffers-functions` is if packages like `hyperdrive.el` are >> intended to use `buffer-offer-save`? > > IIUC the purpose is to save things that are kept in variables rather > than buffers. Good to know. Thanks! From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 06:53:54 2023 Received: (at 65414) by debbugs.gnu.org; 4 Sep 2023 10:53:55 +0000 Received: from localhost ([127.0.0.1]:48883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd7DO-0006M8-Hp for submit@debbugs.gnu.org; Mon, 04 Sep 2023 06:53:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd7DM-0006Lu-3t for 65414@debbugs.gnu.org; Mon, 04 Sep 2023 06:53:53 -0400 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 1qd7DE-0002Jn-I4; Mon, 04 Sep 2023 06:53:44 -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=PW05xe4eUsdizniAZU4Z2EaRH01aADeRglnHGnwR6uI=; b=D9JvOnRludJQ rxxsII+upU7s1F8f1msTng+lqx0l4wsYLR+stHcFiqWyIwtYAfdiCpYEQnA0gcTVUYQ2Yi0L04E44 qVItiPsx3cvkb64q8VjbequCIkpic2vmzVlRkf9j5LvcfkTlZA/XAKFHYtbYolhVCj96yZ1i+sDg3 rEm2TiDIhyzrLlRWkrA6EA1PZUoEJvWeCtKoNBhmqK1OumlVjf3ktntJTBr17sytzsepYxxTdyyfh 6D9Q6j+POpkWRQCsVE8ZURdNz0eOUVg1zMQBZapO1m9gNJoYyfl3PGIEcboCfay0UYp/zVnwA4jAb NJ6/co/tyBc413oInxd4JQ==; Date: Mon, 04 Sep 2023 13:53:24 +0300 Message-Id: <83r0ne5hwb.fsf@gnu.org> From: Eli Zaretskii To: Joseph Turner In-Reply-To: <87bkejnm6i.fsf@breatheoutbreathe.in> (message from Joseph Turner on Sun, 03 Sep 2023 10:52:39 -0700) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> <87bkejnm6i.fsf@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, monnier@iro.umontreal.ca, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Joseph Turner > Cc: Eli Zaretskii , 65414@debbugs.gnu.org, jonas@bernoul.li > Date: Sun, 03 Sep 2023 10:52:39 -0700 > > > Stefan Monnier writes: > > > [ Arguably, it would be even better to arrange for `hyperdrive.el` to > > save its buffers "in the usual way", i.e. relying on > > `buffer-offer-save`, `save-buffer`, `buffer-save-without-query, ... ] > > I was not aware of `buffer-offer-save`. Thank you for the suggestion! > Since we already rely on `save-buffer`, setting `buffer-offer-save` to t > is much simpler than adding to `save-some-buffers-functions`. It also > resolves the interference between Magit and hyperdrive.el. Does this mean we can close this issue without any changes to the save-some-buffers-functions machinery? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 11:55:01 2023 Received: (at 65414) by debbugs.gnu.org; 4 Sep 2023 15:55:01 +0000 Received: from localhost ([127.0.0.1]:52345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdBun-0006P1-38 for submit@debbugs.gnu.org; Mon, 04 Sep 2023 11:55:01 -0400 Received: from out-224.mta1.migadu.com ([2001:41d0:203:375::e0]:28882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdBuj-0006Op-M3 for 65414@debbugs.gnu.org; Mon, 04 Sep 2023 11:54:59 -0400 Date: Mon, 04 Sep 2023 08:54:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1693842895; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1/Lp78avZ8r2qilPv6xqDc7f3mwxv/ru2piJyZJZGcY=; b=j8wyY9arSjWdBG2tb5QV44hXQdc57UjtPyj7Ltonm2PklKozxBuwyTqFj/+47ObYqpw9Nx N0TDznsBXeDM+RCNwsU/EMKDpxFDyW7AFRBbZk0e0tt4eqiwQc5xvDtyR7Ef0kmRTHcFPV rP//HIWDtmnd8N5GpWNC+etANdu0C7A= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Eli Zaretskii Subject: =?US-ASCII?Q?Re=3A_bug=2365414=3A_save-some-buffers-functions_are_unexp?= =?US-ASCII?Q?ectedly_called_when_save-some-buffers_pred_is_non-nil?= In-Reply-To: <83r0ne5hwb.fsf@gnu.org> References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> <87bkejnm6i.fsf@breatheoutbreathe.in> <83r0ne5hwb.fsf@gnu.org> Message-ID: <2A9D1218-1C5A-4FB5-A3C8-7019822A0105@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65414 Cc: jonas@bernoul.li, monnier@iro.umontreal.ca, 65414@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On September 4, 2023 3:53:24 AM PDT, Eli Zaretskii wrote: >Does this mean we can close this issue without any changes to the >save-some-buffers-functions machinery? That's fine by me, yes=2E Thank you for taking the time to walk me through to a solution!! Joseph From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 11:59:50 2023 Received: (at 65414-done) by debbugs.gnu.org; 4 Sep 2023 15:59:50 +0000 Received: from localhost ([127.0.0.1]:52364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdBzR-0006XH-PQ for submit@debbugs.gnu.org; Mon, 04 Sep 2023 11:59:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48444) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdBzP-0006X4-FI for 65414-done@debbugs.gnu.org; Mon, 04 Sep 2023 11:59:48 -0400 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 1qdBzI-0003ni-R9; Mon, 04 Sep 2023 11:59:40 -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=Xz/UXaFWLU82gRsRjKzGnTAMI+8sVM3y+ksihQZ9DcM=; b=oT6CxAV880VH 1BunJ1U8tf/738b+Bwt+Oicnvdji3bUj4RIxFeDg21LoFzWzwx1nySU8F25fR6KPgs/QP1eR61WKO nqf7+2imxpkHHmABMN3Q4cJfA32RFY0PVE1ziSQJLGCTJArn8vAHpkSeHi5VsK+FhvyU+lcoUYdE7 xJHpquXviVdHGOc4v3my7ui3+EaHSrZ2BKjiOh4J7Y+RmOrSyROKz2fOPD5ZeT80o6fkQe7LXtDRd tQVXKVjLgAPwLO2Fr7naT+Ut9CvKykXMJ3+qXf90UA7/ucjBZZ11mdAN6vM0xSvNP61wtBxfblTRI AmaXLPFpfFh14402EIyFFA==; Date: Mon, 04 Sep 2023 18:59:22 +0300 Message-Id: <83zg223p5x.fsf@gnu.org> From: Eli Zaretskii To: Joseph Turner In-Reply-To: <2A9D1218-1C5A-4FB5-A3C8-7019822A0105@breatheoutbreathe.in> (message from Joseph Turner on Mon, 04 Sep 2023 08:54:52 -0700) Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil References: <871qfxvvw9.fsf@breatheoutbreathe.in> <83lee4vcac.fsf@gnu.org> <87o7ixe1e2.fsf@breatheoutbreathe.in> <83o7ixqatx.fsf@gnu.org> <87fs46cn6u.fsf@breatheoutbreathe.in> <838r9ymfh5.fsf@gnu.org> <874jkmck9j.fsf@breatheoutbreathe.in> <83v8ct9gmg.fsf@gnu.org> <87bkejnm6i.fsf@breatheoutbreathe.in> <83r0ne5hwb.fsf@gnu.org> <2A9D1218-1C5A-4FB5-A3C8-7019822A0105@breatheoutbreathe.in> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65414-done Cc: jonas@bernoul.li, monnier@iro.umontreal.ca, 65414-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 04 Sep 2023 08:54:52 -0700 > From: Joseph Turner > CC: monnier@iro.umontreal.ca, 65414@debbugs.gnu.org, jonas@bernoul.li > > > > On September 4, 2023 3:53:24 AM PDT, Eli Zaretskii wrote: > >Does this mean we can close this issue without any changes to the > >save-some-buffers-functions machinery? > > That's fine by me, yes. Done. > Thank you for taking the time to walk me through to a solution!! You are welcome. From unknown Sun Aug 10 16:50:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 03 Oct 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator