From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#67393: 29.1; Slow to open file if autosave exists Date: Mon, 25 Dec 2023 16:50:33 +0000 Message-ID: <87zfxymdk6.fsf@localhost> 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> <87mstz1l0b.fsf@localhost> <83bkafbdto.fsf@gnu.org> <87bkaf1iux.fsf@localhost> <83a5pzbbg7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30290"; mail-complaints-to="usenet@ciao.gmane.io" Cc: materus213@gmail.com, 67393@debbugs.gnu.org, stefankangas@gmail.com, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 25 17:48:21 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 1rHo7o-0007hb-Bi for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Dec 2023 17:48:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHo7R-0002ww-6p; Mon, 25 Dec 2023 11:47:57 -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 1rHo7P-0002wT-Gf for bug-gnu-emacs@gnu.org; Mon, 25 Dec 2023 11:47:55 -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 1rHo7P-0002Jm-1s for bug-gnu-emacs@gnu.org; Mon, 25 Dec 2023 11:47:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rHo7V-0004fr-LQ for bug-gnu-emacs@gnu.org; Mon, 25 Dec 2023 11:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Dec 2023 16:48: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.170352285917834 (code B ref 67393); Mon, 25 Dec 2023 16:48:01 +0000 Original-Received: (at 67393) by debbugs.gnu.org; 25 Dec 2023 16:47:39 +0000 Original-Received: from localhost ([127.0.0.1]:55221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHo78-0004dY-O1 for submit@debbugs.gnu.org; Mon, 25 Dec 2023 11:47:39 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:41557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rHo75-0004d4-03 for 67393@debbugs.gnu.org; Mon, 25 Dec 2023 11:47:37 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CF7A3240104 for <67393@debbugs.gnu.org>; Mon, 25 Dec 2023 17:47:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703522841; bh=IWOaXr8Fe9C4ezkaT2hzLrHt5uqrzWysQ+l5Yu8lNwc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=jMa/mKT06lLn6XfZ4lbFFeVq6Bp1UbKOwiIOvc9ZumrscZj/BXvuvobGi36hDsrQy ICxXLAeY9GNsLQ2qIzwCoFr/YXr7w+Y/tWpgc+LnLizsz34gbmvEj1gxn6GeZv4Keb IXLxZWrF928Y9pUpuY0mYeNYplgtk4aGzBjnrbIf1FrHQoBl6n2ohwJCU8C3T1amHN 4e+6IEukhuLxGIFDy869o6GiKsfD1VWrgmfRds+8lEQ9+ziujI5KlAz9wh2o2DPpcV AQAnFi9EYvQs6vsJZ2itF39NUDsyYfWgh1yTi166PCiQbB3rgGVJEm6D6IdVpxV7CO YNhL0AVcO3uKA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SzP2d0zckz6twc; Mon, 25 Dec 2023 17:47:20 +0100 (CET) In-Reply-To: <83a5pzbbg7.fsf@gnu.org> 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:276871 Archived-At: Eli Zaretskii writes: >> Then, the "important" messages should be written in such a way that they >> can be understood later, away from the immediate context of the message >> trigger. > > I don't think I understand what this means in practice. Can you show > what will be displayed in the mini-window in this case, and how to > make the "important" message stand out? For example, the message "File exists, but cannot be read" from `after-find-file' may be written as "Opening file: exists, but cannot be read" >> > How is this better than waiting for a second? >>=20 >> 1. Waiting for a second creates a temptation to press C-g without >> thinking and get the original message replaced with "Quit". >>=20 >> 2. The message can be read later (not just within one second). For >> example after a distraction in RL and being away from Emacs or a >> short moment. > > Again: how will this look in practice, including the dismissal action? Try the following proof-of-concept code: (defvar important-message-list nil) (defun set-important-message (message) "Return the last message and previous important messages as one string. Individual messages will be separated by a newline and the last message wil= l be separated by \"--\". The previous messages will be displayed no longer than 'message-timeout pro= perty seconds (if 0 - forever). The previous messages may be dismissed via `remove-previous-message' command. Note that this feature works best only when `resize-mini-windows' is at its default value `grow-only'." (catch :continue (let ((last-message (car important-message-list)) (tail (cdr important-message-list))) (while last-message (let ((timeout (aref last-message 2))) (cond ((=3D timeout 0) (throw :continue t)) ((> (float-time) (+ (aref last-message 0) timeout)) (setq important-message-list (delete last-message important-mes= sage-list))))) (setq last-message (car tail) tail (cdr tail))))) (prog1 (if important-message-list (format "%s\n%s\n%s" (mapconcat (lambda (m) (aref m 1)) (reverse important-message-list) "\n") (make-string (frame-width) ?=E2=94=80) message) message) (when (get-text-property 0 'message-timeout message) (push (vector (float-time) (substring-no-properties (copy-sequence message)) (get-text-property 0 'message-timeout message)) important-message-list)))) (defun remove-previous-message (&optional n) "Remove the oldest important message displayed. With numeric prefix argument N, remove N's message." (interactive "p") (unless important-message-list (user-error "No important messages are dis= played.")) (let ((target (nth (or (and n (1+ n)) 0)))) (setq important-message-list (delete target important-message-list)))) (setq set-message-function #'set-important-message) (message (propertize "This is a test!" 'message-timeout 0)) (message (propertize "This will disappear in 3 seconds" 'message-timeout 3)) (message "foo") ;; M-x remove-previous-message to remove the displayed message. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at