all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Terje Larsen <terje.larsen@klarna.com>
To: Eli Zaretskii <eliz@gnu.org>, 33490@debbugs.gnu.org
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	[thread overview]
Message-ID: <A71FB16F-6E55-403A-9529-9FA1A8885884@klarna.com> (raw)
In-Reply-To: <83pnuujp4r.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 23532 bytes --]

  reply	other threads:[~2018-11-24 20:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-24 11:56 bug#33490: 27.0.50; auto-save-visited-mode clears the echo area every time the save interval is hit Terje Larsen
2018-11-24 18:40 ` Eli Zaretskii
2018-11-24 20:26   ` Terje Larsen [this message]
2018-11-26 17:29     ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A71FB16F-6E55-403A-9529-9FA1A8885884@klarna.com \
    --to=terje.larsen@klarna.com \
    --cc=33490@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.