From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Terje Larsen Newsgroups: gmane.emacs.bugs Subject: bug#33490: 27.0.50; auto-save-visited-mode clears the echo area every time the save interval is hit Date: Sat, 24 Nov 2018 21:26:06 +0100 Message-ID: References: <83pnuujp4r.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_650F5D07-DC65-4670-A598-53F18C474EDB" X-Trace: blaine.gmane.org 1543091117 4570 195.159.176.226 (24 Nov 2018 20:25:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Nov 2018 20:25:17 +0000 (UTC) To: Eli Zaretskii , 33490@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 24 21:25:13 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQeUH-0000wu-Lr for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Nov 2018 21:25:10 +0100 Original-Received: from localhost ([::1]:57646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQeWO-0006ZP-0N for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Nov 2018 15:27:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gQeWD-0006ZH-AQ for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 15:27:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gQeW9-0005Ol-8X for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 15:27:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41565) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gQeW8-0005OV-C6 for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 15:27:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gQeW8-0002Nf-8j for bug-gnu-emacs@gnu.org; Sat, 24 Nov 2018 15:27:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Terje Larsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Nov 2018 20:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33490 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33490-submit@debbugs.gnu.org id=B33490.15430911769090 (code B ref 33490); Sat, 24 Nov 2018 20:27:04 +0000 Original-Received: (at 33490) by debbugs.gnu.org; 24 Nov 2018 20:26:16 +0000 Original-Received: from localhost ([127.0.0.1]:45823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQeVM-0002MX-7F for submit@debbugs.gnu.org; Sat, 24 Nov 2018 15:26:16 -0500 Original-Received: from mail-lj1-f171.google.com ([209.85.208.171]:37147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gQeVK-0002MJ-96 for 33490@debbugs.gnu.org; Sat, 24 Nov 2018 15:26:15 -0500 Original-Received: by mail-lj1-f171.google.com with SMTP id e5-v6so13252751lja.4 for <33490@debbugs.gnu.org>; Sat, 24 Nov 2018 12:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klarna.com; s=google; h=from:mime-version:subject:date:references:to:in-reply-to:message-id; bh=PIn8DdtlA0jazY4yPO6PVsXGhPxg+jRQNoFX5GB1acg=; b=UAx6NbR7vKmtQca5vIBnN65Yeq/dWvv8VazoujHKn3o0K7nSoRGMvxG6J+L4lpbi7U KD0+1oUlXOFosrHGglq7uma08KX10lGVrhC1g5znk8MM6Rq68WZyay/Syglxj7BfVtad Fg63WqWxI2rsmTdPyYEuGC7s/8eFye7Z9DJoGqlKnFTkQoSc6aUOPkOkSj9vX71rEqXh ia0wajncXzJRt9CAepjhS8mQALWmTFg+wVauk7mhHwRYB8e/CZKNAfCT3UlweZnY2gXa L4RnyM6GRBtpCFC3cWXKvH8V6vk36+pzLTKs+9/rW+US7ylUM+J0nBYjn43/OR8HoCC+ IYfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=PIn8DdtlA0jazY4yPO6PVsXGhPxg+jRQNoFX5GB1acg=; b=ZYtr32rNlDP5m5L3CIiGrgxDaEnB81e0OBNvxWRrKV4lpvPX8IESn+KAveGTNZGe8+ UBPsXhFCjgsW74Jc4+Sw2qBeYmk1IsGZZdyIG38LlSFvkJEDsogfPc05FYU5nSB6TFwQ C+xVUsFWuhpR5c+YZbYb9vMgtao5Pzld6ltyNXceELE3TZ7efabJb5d5/s9p3LWUZxUf eOcieVajH4m08Fy9CwOvux2AriZuIJLm1IHIkfBQBHA6wkaL75a1I3x0n+F1Lf3Qb7/h hMeMOfywq0CzFfyiF1+M1FPceWETt89katbxhnPpQo4ocqi2URDbrORL3rckZ7zYf4dY aRpw== X-Gm-Message-State: AGRZ1gIfThhASnERN3metQ0Z1mMGUU1JjRHB3Rc7XhdUx9zH+sdXADhH BDu4SkUs3s3v/cN941vj44cKBw== X-Google-Smtp-Source: AFSGD/WGnv2IIsCzgUJWkcBQJJpKJcci6/JQkyxs1ff8PnaWANDB9pUqVymawKgrXJLbwag5csiIIA== X-Received: by 2002:a2e:95c6:: with SMTP id y6-v6mr12720411ljh.59.1543091168250; Sat, 24 Nov 2018 12:26:08 -0800 (PST) Original-Received: from [10.0.1.6] (h-155-4-130-49.NA.cust.bahnhof.se. [155.4.130.49]) by smtp.gmail.com with ESMTPSA id c5-v6sm8537811lja.62.2018.11.24.12.26.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Nov 2018 12:26:07 -0800 (PST) In-Reply-To: <83pnuujp4r.fsf@gnu.org> X-Mailer: Apple Mail (2.3445.101.1) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152741 Archived-At: --Apple-Mail=_650F5D07-DC65-4670-A598-53F18C474EDB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Thank you for the quick fix, that seems to solve the issue. Applying this patch and repeating the same kind of testing procedure = produced the expected result. > On 24 Nov 2018, at 19:40, Eli Zaretskii wrote: >=20 >> From: Terje Larsen >> Date: Sat, 24 Nov 2018 12:56:19 +0100 >>=20 >> M-x auto-save-visited-mode >> M-: (message "%s" "hello") >>=20 >> ... Wait 5 seconds ... >>=20 >> Now the message buffer gets cleared and you lose the message. This is >> causing usability issues when using eldoc/reading some output message = as >> it continously gets cleared. >>=20 >> I would expect the `auto-save-visited' feature to not change the = behaviour >> of the Echo Area. If you compare this to the `auto-save-mode' which >> outputs a message indicating a save, but restores the Echo Area = after. >>=20 >> I have tracked down this to the `save-some-buffers' function or more >> specifically the `map-y-or-n-p' function that it calls. In this = function >> there is a call to message like `(message "")`. >=20 > Right. Does the patch below fix the problem? >=20 > diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el > index 8260af5..93235bd 100644 > --- a/lisp/emacs-lisp/map-ynp.el > +++ b/lisp/emacs-lisp/map-ynp.el > @@ -79,6 +79,7 @@ map-y-or-n-p >=20 > Returns the number of actions taken." > (let* ((actions 0) > + (msg (current-message)) > user-keys mouse-event map prompt char elt def > ;; Non-nil means we should use mouse menus to ask. > use-menus > @@ -250,9 +251,10 @@ map-y-or-n-p > (if delayed-switch-frame > (setq unread-command-events > (cons delayed-switch-frame unread-command-events)))) > - ;; Clear the last prompt from the minibuffer. > + ;; Clear the last prompt from the minibuffer, and restore the > + ;; previous echo-area message, if any. > (let ((message-log-max nil)) > - (message "")) > + (message (or msg ""))) > ;; Return the number of actions that were taken. > actions)) --Apple-Mail=_650F5D07-DC65-4670-A598-53F18C474EDB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Thank= you for the quick fix, that seems to solve the issue.
Applying this patch and repeating the same kind of testing = procedure produced the expected result.

On 24 = Nov 2018, at 19:40, Eli Zaretskii <eliz@gnu.org> wrote:

From: = Terje Larsen <terje.larsen@klarna.com>
Date: Sat, 24 = Nov 2018 12:56:19 +0100

M-x = auto-save-visited-mode
M-: (message "%s" "hello")

... Wait 5 seconds ...

Now the message buffer gets cleared and you lose the message. = This is
causing usability issues when using eldoc/reading = some output message as
it continously gets cleared.

I would expect the `auto-save-visited' feature = to not change the behaviour
of the Echo Area. If you = compare this to the `auto-save-mode' which
outputs a = message indicating a save, but restores the Echo Area after.

I have tracked down this to the = `save-some-buffers' function or more
specifically the = `map-y-or-n-p' function that it calls. In this function
there is a call to message like `(message "")`.

Right.  Does the patch below fix the problem?

diff --git = a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index 8260af5..93235bd = 100644
--- = a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -79,6 +79,7 @@ = map-y-or-n-p

Returns the = number of actions taken."
  (let* ((actions 0)
+         (msg = (current-message))
=  user-keys mouse-event map = prompt char elt def
=  ;; Non-nil means we should = use mouse menus to ask.
=  use-menus
@@ -250,9 +251,10 @@ = map-y-or-n-p
      (if = delayed-switch-frame
=   (setq = unread-command-events
= (cons = delayed-switch-frame unread-command-events))))
-    ;; Clear the = last prompt from the minibuffer.
+    ;; Clear the last prompt from the = minibuffer, and restore the
+    ;; previous echo-area message, if = any.
    (let ((message-log-max = nil))
- =      (message ""))
+ =      (message (or msg "")))
    ;; = Return the number of actions that were taken.
    actions))

= --Apple-Mail=_650F5D07-DC65-4670-A598-53F18C474EDB--