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

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

Eli Zaretskii <[email-masked]> writes:

>> For example, the message "File exists, but cannot be read" from
>> `after-find-file' may be written as
>> 
>> "Opening file: <filename> exists, but cannot be read"
>
> Sorry, but I don't see how this would help.  "Opening file" could
> allude to anything; Emacs opens a lot of files all the time.  A
> delayed message will run a high risk of missing its point, unless it
> presents a lot of relevant context, as a minimum the command which
> caused it with that command's arguments.

Do note that I am not proposing to delay the message. It will be
displayed immediately; just will not block.

As for missing the point, the point is either current command opening a
file - then, the context is clear; or a complex command doing many
things, including opening a file - then, I doubt that blocking is very
helpful.

> And having said that, I'm not sure this is a good idea even if we
> present enough context.  For starters, many messages must be acted
> upon immediately.

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.

>> > Again: how will this look in practice, including the dismissal action?
>> 
>> Try the following proof-of-concept code:
>
> Thanks, but this would mean a complete redesign of the Emacs messaging
> UI.  This kind of display no longer fits the mini-window paradigm we
> are using, it will need a separate large enough window for showing
> series of messages (in which case we don't need to much wizardry to
> scroll through them and selectively delete them).  Do we really want
> to make such drastic changes in our UI?

I believe that such changes would be helpful.
Apart from addressing the problem here, they might be useful to address
the concerns about messages displayed by Elisp threads, timers, and
async process callbacks. Also, if we ever get true multithreading, some
way to display and separate messages coming simultaneously would be
a good thing to have.

-- 
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>