Subject: bug#67393: 29.1; Slow to open file if autosave exists

From: Eli Zaretskii <[email-masked]>
Date: Wed, 27 Dec 2023 14:34:01 +0200

> From: Ihor Radchenko <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked],
>  [email-masked]
> Date: Mon, 25 Dec 2023 20:17:28 +0000
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> Consider that some command opens files one by one in sequence and one of
> >> these files has auto save data. `after-find-file' will pause that
> >> command, display the message, block Emacs (not allowing user to do
> >> anything), and then continue running the command. User has no chance to
> >> do anything about the auto save recovery until the command is finished
> >> and also has to wait extra few seconds while Emacs is blocked.
> >> (This is a real case I encountered with M-x org-agenda)
> >
> > Such a command, if it existed, should perhaps provide a better
> > opportunity for the users, like prompt them for whether to recover
> > from each autosave file before continuing to the next one.
> 
> May you please elaborate how a command calling of `find-file' or similar
> can provide such prompt?

I'm not sure I understand what you mean, because the answer seems too
obvious: just prompt after opening each file that has autosave data.
But that's probably not what you had in mind.

> >> In contrast, what I propose would make sure that the message is
> >> displayed for at least some period of time after the command finishes.
> >
> > Imagine a command that needs the user to respond within a short time
> > interval, after which the message becomes irrelevant, because the
> > situation changed in a way that the information there is not longer
> > pertinent.  Like in those mythical Mission Impossible movies: this
> > message will auto-destruct in 5 seconds.  How will leaving all of
> > those message on display help in that case?
> 
> I consider such situation worth a full interactive prompt, not limited
> to 5 seconds.
> 
> For example, C-x C-f could prompt about recovering from backup file, if
> such file is detected.

Yes.  My point being that just a fire-and-forget message is not good
in these cases anyway, so the issue we are discussing doesn't have to
cater to such cases.

> >> Moreover, if multiple files have auto save data, messages about all
> >> these files will be displayed together without a need to dig into
> >> *Messages* buffer.
> >
> > "Dig into *Messages*" is a strange phrase to hear from a veteran Emacs
> > user.  I'd expect looking in *Messages* to be your second nature.
> 
> It is not.
> 
> > Some users even have the habit of leaving *Messages* constantly on
> > display -- there's your "leave messages on display" proposal already
> > available if someone wants that.
> 
> After `set-multi-message' became a thing, I no longer need to consult
> *Messages* often. `set-multi-message' was really an eye-opener on how
> much useful information I miss when messages are coming in quick
> succession.

To each their own.  I think set-multi-message has its uses, but I
don't think it can solve all of the cases, in particular those where
we need to attract the users' attention to a particularly important
message.