From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: materus213@gmail.com, yantar92@posteo.net, 67393@debbugs.gnu.org,
stefankangas@gmail.com
Subject: bug#67393: 29.1; Slow to open file if autosave exists
Date: Thu, 28 Dec 2023 09:57:01 +0200 [thread overview]
Message-ID: <86bkaa7oaa.fsf@mail.linkov.net> (raw)
In-Reply-To: <83h6k38s9g.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Dec 2023 19:33:31 +0200")
>> >> (ding) ; error message from ispell!
>> >> (message "Ispell error: %s" output)
>> >> (sit-for 5)
>> >>
>> >> So I need to waste 5 seconds several times during spell-checking.
>> >
>> > Only when there's an error, right?
>>
>> Often during spell-checking it's really not an error, but a warning
>> that text in some unsupported encoding can't be spell-checked.
>
> "Unsupported encoding"? Last time I saw this was when I was using
> ispell as the speller. Since I switched to Hunspell years ago, these
> problems are gone for good, since Hunspell uses UTF-8. How come you
> still see this?
This happens occasionally with Hunspell, but I can't explain why,
maybe due to misconfiguration. I could debug this later.
>> I propose to refactor such code
>>
>> (message "Ispell error: %s" output)
>> (sit-for 5)
>>
>> to a new separate function, e.g.
>>
>> (important-message 5 "Ispell error: %s" output)
>>
>> with a simple implementation
>>
>> (defun important-message (seconds format-string &rest args)
>> (apply #'message format-string args)
>> (sit-for seconds))
>>
>> Then users could easily override such annoying delay.
>> Or maybe even the default implementation can check
>> if set-message-functions already contains set-multi-message
>> that ensures that the important message will not be missed,
>> and not to use sit-for in this case.
>
> I don't mind much, but is this really the best we can do?
This is just the first thing that we could do.
So the first task is to find all such places,
and replace them with the single function call.
> Asking users to customize Emacs by overriding functions is not very
> friendly, and in this case we certainly could do better, for example
> by making 5 be a defcustom.
A defcustom would be one option. 'set-important-message' like
implemented by Ihor would be another option. All this could be
added after creating the new function 'important-message'.
next prev parent reply other threads:[~2023-12-28 7:57 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-23 0:28 bug#67393: 29.1; Slow to open file if autosave exists materus213
2023-11-23 6:51 ` Eli Zaretskii
2023-12-22 14:56 ` Stefan Kangas
2023-12-23 14:34 ` Ihor Radchenko
2023-12-23 17:23 ` Juri Linkov
2023-12-23 18:05 ` Ihor Radchenko
2023-12-24 17:34 ` Juri Linkov
2023-12-24 18:39 ` Eli Zaretskii
2023-12-24 19:03 ` Ihor Radchenko
2023-12-24 19:28 ` Eli Zaretskii
2023-12-24 19:49 ` Ihor Radchenko
2023-12-24 20:19 ` Eli Zaretskii
2023-12-25 16:50 ` Ihor Radchenko
2023-12-25 16:58 ` Eli Zaretskii
2023-12-25 17:18 ` Ihor Radchenko
2023-12-25 17:34 ` Eli Zaretskii
2023-12-25 18:40 ` Ihor Radchenko
2023-12-25 19:08 ` Eli Zaretskii
2023-12-25 20:17 ` Ihor Radchenko
2023-12-27 12:34 ` Eli Zaretskii
2023-12-28 13:59 ` Ihor Radchenko
2023-12-27 17:20 ` Juri Linkov
2023-12-27 17:33 ` Eli Zaretskii
2023-12-28 7:57 ` Juri Linkov [this message]
2024-01-16 16:36 ` Juri Linkov
2024-01-16 17:10 ` Eli Zaretskii
2024-01-16 17:43 ` Juri Linkov
2024-01-16 18:51 ` Eli Zaretskii
2024-01-17 16:48 ` Juri Linkov
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=86bkaa7oaa.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=67393@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=materus213@gmail.com \
--cc=stefankangas@gmail.com \
--cc=yantar92@posteo.net \
/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).