unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Joseph Turner <joseph@breatheoutbreathe.in>
Cc: jonas@bernoul.li, 65414@debbugs.gnu.org
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	[thread overview]
Message-ID: <83o7ixqatx.fsf@gnu.org> (raw)
In-Reply-To: <87o7ixe1e2.fsf@breatheoutbreathe.in> (message from Joseph Turner on Wed, 23 Aug 2023 16:57:06 -0700)

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: 65414@debbugs.gnu.org, jonas@bernoul.li
> Date: Wed, 23 Aug 2023 16:57:06 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> 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.





  reply	other threads:[~2023-08-24  5:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  4:06 bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-21 11:56 ` Eli Zaretskii
2023-08-23 23:57   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24  5:16     ` Eli Zaretskii [this message]
2023-08-26  6:38       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-26  7:26         ` Eli Zaretskii
2023-08-26  7:32           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02  7:30             ` Eli Zaretskii
2023-09-03 17:06               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 17:29                 ` Eli Zaretskii
2023-09-03 17:52                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 19:03                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 19:04                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 10:53                   ` Eli Zaretskii
2023-09-04 15:54                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 15:59                       ` Eli Zaretskii
2023-09-03 17:22               ` Juri Linkov
2023-09-03 17:44                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83o7ixqatx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=65414@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    --cc=joseph@breatheoutbreathe.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).