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

Package: emacs;

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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33490 in the body.
You can then email your comments to 33490 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33490; Package emacs. (Sat, 24 Nov 2018 18:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Terje Larsen <terje.larsen <at> klarna.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 24 Nov 2018 18:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Terje Larsen <terje.larsen <at> klarna.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; auto-save-visited-mode clears the echo area every time the
 save interval is hit
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 "")`.


In GNU Emacs 27.0.50 (build 2, x86_64-apple-darwin18.0.0, NS appkit-1671.00 Version 10.14 (Build 18A391))
of 2018-11-07 built on C02V91MHHV2Q.local
Repository revision: 811d9291fcfb12d87bad277d4e8b25152129d73d
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.1

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Auto-Save-Visited mode enabled
You can run the command ‘auto-save-visited-mode’ with M-x au-v RET
Auto-Save-Visited mode enabled
hello
"hello"
Making completion list... [2 times]

Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=/usr/local/share/emacs/site-lisp
--infodir=/usr/local/Cellar/emacs/HEAD-811d929_1/share/info/emacs
--prefix=/usr/local/Cellar/emacs/HEAD-811d929_1 --with-gnutls
--without-x --with-xml2 --without-dbus --with-imagemagick --with-rsvg
--with-ns --disable-ns-self-contained'

Configured features:
RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS NS THREADS LCMS2 GMP

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-save-visited-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
easymenu mml-sec password-cache epa derived epg epg-config gnus-util
rmail rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cus-start
cus-load elec-pair tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process
emacs)

Memory information:
((conses 16 211301 10028)
(symbols 48 20869 1)
(strings 32 30416 1948)
(string-bytes 1 793438)
(vectors 16 35289)
(vector-slots 8 725548 23404)
(floats 8 47 72)
(intervals 56 245 0)
(buffers 992 12))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33490; Package emacs. (Sat, 24 Nov 2018 18:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 33490 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Terje Larsen <terje.larsen <at> klarna.com>
Cc: 33490 <at> debbugs.gnu.org
Subject: Re: 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 20:40:04 +0200
> 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))
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33490; Package emacs. (Sat, 24 Nov 2018 20:27:04 GMT) Full text and rfc822 format available.

Message #11 received at 33490 <at> debbugs.gnu.org (full text, mbox):

From: Terje Larsen <terje.larsen <at> klarna.com>
To: Eli Zaretskii <eliz <at> gnu.org>,
 33490 <at> debbugs.gnu.org
Subject: Re: 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 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)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 26 Nov 2018 17:30:02 GMT) Full text and rfc822 format available.

Notification sent to Terje Larsen <terje.larsen <at> klarna.com>:
bug acknowledged by developer. (Mon, 26 Nov 2018 17:30:02 GMT) Full text and rfc822 format available.

Message #16 received at 33490-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Terje Larsen <terje.larsen <at> klarna.com>
Cc: 33490-done <at> debbugs.gnu.org
Subject: Re: bug#33490: 27.0.50; auto-save-visited-mode clears the echo area
 every time the save interval is hit
Date: Mon, 26 Nov 2018 19:29:17 +0200
> From: Terje Larsen <terje.larsen <at> klarna.com>
> Date: Sat, 24 Nov 2018 21:26:06 +0100
> 
> 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.

Thanks, pushed to the emacs-26 branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Dec 2018 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.