GNU bug report logs -
#33490
27.0.50; auto-save-visited-mode clears the echo area every time the save interval is hit
Previous Next
Reported by: Terje Larsen <terje.larsen <at> klarna.com>
Date: Sat, 24 Nov 2018 18:00:03 UTC
Severity: normal
Found in version 27.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 33490 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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 <at> gnu.org> wrote:
>
>> From: Terje Larsen <terje.larsen <at> 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))
[Message part 2 (text/html, inline)]
This bug report was last modified 6 years and 180 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.