From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#67393: 29.1; Slow to open file if autosave exists Date: Thu, 28 Dec 2023 09:57:01 +0200 Organization: LINKOV.NET Message-ID: <86bkaa7oaa.fsf@mail.linkov.net> References: <83a5r5gdxk.fsf@gnu.org> <87frztc7iy.fsf@localhost> <867cl4kg4l.fsf@mail.linkov.net> <87cyuwdcb4.fsf@localhost> <868r5jse0m.fsf@mail.linkov.net> <83r0jbbg2z.fsf@gnu.org> <86a5pv508o.fsf@mail.linkov.net> <83h6k38s9g.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7640"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: materus213@gmail.com, yantar92@posteo.net, 67393@debbugs.gnu.org, stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 28 08:59:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rIlIc-0001rG-Ed for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Dec 2023 08:59:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIlII-0002xt-Fa; Thu, 28 Dec 2023 02:59:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rIlIE-0002xb-Q3 for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 02:59:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rIlIE-0007eG-GS for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 02:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIlID-0001dP-Iv for bug-gnu-emacs@gnu.org; Thu, 28 Dec 2023 02:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Dec 2023 07:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67393 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 67393-submit@debbugs.gnu.org id=B67393.17037503226257 (code B ref 67393); Thu, 28 Dec 2023 07:59:01 +0000 Original-Received: (at 67393) by debbugs.gnu.org; 28 Dec 2023 07:58:42 +0000 Original-Received: from localhost ([127.0.0.1]:38342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIlHt-0001cr-Id for submit@debbugs.gnu.org; Thu, 28 Dec 2023 02:58:41 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:46519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIlHq-0001cc-Uz for 67393@debbugs.gnu.org; Thu, 28 Dec 2023 02:58:39 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 046971BF206; Thu, 28 Dec 2023 07:58:31 +0000 (UTC) In-Reply-To: <83h6k38s9g.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Dec 2023 19:33:31 +0200") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276956 Archived-At: >> >> (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'.