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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: jonas <at> bernoul.li, 65414 <at> debbugs.gnu.org, Joseph Turner <joseph <at> breatheoutbreathe.in>
Subject: bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
Date: Sun, 03 Sep 2023 13:06:07 -0400
>> > 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





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.