GNU bug report logs - #65414
save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil

Previous Next

Package: emacs;

Reported by: Joseph Turner <joseph <at> breatheoutbreathe.in>

Date: Mon, 21 Aug 2023 04:54:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Subject: bug#65414: closed (Re: bug#65414: save-some-buffers-functions are
 unexpectedly called when save-some-buffers pred is non-nil)
Date: Mon, 04 Sep 2023 16:00:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 65414 <at> debbugs.gnu.org.

-- 
65414: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65414
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: jonas <at> bernoul.li, monnier <at> iro.umontreal.ca, 65414-done <at> debbugs.gnu.org
Subject: Re: bug#65414: save-some-buffers-functions are unexpectedly called
 when save-some-buffers pred is non-nil
Date: Mon, 04 Sep 2023 18:59:22 +0300
> Date: Mon, 04 Sep 2023 08:54:52 -0700
> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
> CC: monnier <at> iro.umontreal.ca, 65414 <at> debbugs.gnu.org, jonas <at> bernoul.li
> 
> 
> 
> On September 4, 2023 3:53:24 AM PDT, Eli Zaretskii <eliz <at> gnu.org> 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.

[Message part 3 (message/rfc822, inline)]
From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: bug-gnu-emacs <at> gnu.org
Cc: jonas <at> bernoul.li
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
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



This bug report was last modified 1 year and 312 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.