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

From: Ihor Radchenko <[email-masked]>
Date: Mon, 25 Dec 2023 18:40:08 +0000

Eli Zaretskii <[email-masked]> writes:

>> I'd argue that messages that _must_ be acted, should not be messages.
>> They should query user for action instead of blocking Emacs and not
>> allowing to do anything other than C-g.
>
> You do realize that this is contrary to everything we currently do in
> Emacs, right?  We should the messages that must be acted upon
> immediately, and use sit-for to make sure the user sees the message
> and has an opportunity to act upon it.  The message which started this
> discussion was just like that: it informed the user that an autosave
> file exists, so the user should consider using it.

I disagree that sit-for gives an opportunity to act upon the message
discussed in the bug report: "%s has auto save data; consider \\`M-x
recover-this-file'".

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)

In contrast, what I propose would make sure that the message is
displayed for at least some period of time after the command finishes.
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.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>