GNU bug report logs - #19064
25.0.50; `message' overwrites `y-or-n-p' prompt, so user misses it

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 15 Nov 2014 18:39:02 UTC

Severity: wishlist

Tags: confirmed, fixed

Merged with 446, 17272

Found in versions 24.4.50, 25.0.50

Fixed in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, 17272 <at> debbugs.gnu.org, 19064 <at> debbugs.gnu.org
Subject: bug#19064: bug#17272: bug#19064: bug#17272: bug#19064: 25.0.50; `message' overwrites `y-or-n-p' prompt, so user misses it
Date: Wed, 20 Nov 2019 00:28:15 +0200
>> The variable name is ‘message-in-echo-area’.  After a little testing,
>> it seems to handle all such cases well:
>
> I have not tested the patch, but it looks good to me.

Actually this patch needs more testing.  I found already
two cases that might be annoying.  Better to anticipate
a possible angry reaction and fix these cases in advance.

The first case is when doing completion, the message
"Making completion list..." is displayed in the minibuffer
for 2 seconds. I don't understand why this message is needed at all,
but at least this patch restores its previous behavior
that displays that message in the echo area and doesn't wait.

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 6e72eb73f9..b3fc3b8ab0 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1838,7 +1838,7 @@ completion--done
 (defun minibuffer-completion-help (&optional start end)
   "Display a list of possible completions of the current minibuffer contents."
   (interactive)
-  (message "Making completion list...")
+  (message-in-echo-area "Making completion list...")
   (let* ((start (or start (minibuffer-prompt-end)))
          (end (or end (point-max)))
          (string (buffer-substring start end))
@@ -1849,7 +1849,7 @@ minibuffer-completion-help
                        minibuffer-completion-predicate
                        (- (point) start)
                        md)))
-    (message nil)
+    (message-in-echo-area nil)
     (if (or (null completions)
             (and (not (consp (cdr completions)))
                  (equal (car completions) string)))

Another case when using isearch in minibuffer, the failed search
message is displayed at the end of the minibuffer instead of
in the search prompt in the echo area.  This patch restores
the previous behavior:

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 4f3342782d..1705b050b5 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2011,7 +2011,7 @@ isearch-message-properties
 (defun isearch--momentary-message (string)
   "Print STRING at the end of the isearch prompt for 1 second."
   (let ((message-log-max nil))
-    (message "%s%s%s"
+    (message-in-echo-area "%s%s%s"
              (isearch-message-prefix nil isearch-nonincremental)
              isearch-message
              (apply #'propertize (format " [%s]" string)
@@ -3168,7 +3170,7 @@ isearch-message
 	     (isearch-message-prefix ellipsis isearch-nonincremental)
 	     m
 	     (isearch-message-suffix c-q-hack)))
-    (if c-q-hack m (let ((message-log-max nil)) (message "%s" m)))))
+    (if c-q-hack m (let ((message-log-max nil)) (message-in-echo-area "%s" m)))))
 
 (defun isearch--describe-regexp-mode (regexp-function &optional space-before)
   "Make a string for describing REGEXP-FUNCTION.




This bug report was last modified 5 years and 173 days ago.

Previous Next


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