unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#60015: 29.0.60; multi-line messages truncated in non-selected minibuffer
@ 2022-12-12 18:03 Juri Linkov
  2022-12-12 18:19 ` Eli Zaretskii
  0 siblings, 1 reply; 21+ messages in thread
From: Juri Linkov @ 2022-12-12 18:03 UTC (permalink / raw)
  To: 60015

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

0. emacs -Q
1. (run-with-timer 5 5 'message "abc\ndef")
2. then activate the minibuffer and switch back to the original buffer
3. after some time observe that only the first line of the multi-line message
   is displayed in the minibuffer

I don't know where this problem comes from, but it's impossible to use
edebug to debug minibuffer-related bugs while the minibuffer is active,
because only an old message is displayed, not the most recent,
when using set-multi-message to collect messages.  So here is
at least the fix for set-multi-message:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: set-multi-message.patch --]
[-- Type: text/x-diff, Size: 1121 bytes --]

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index cfdf2b43f42..36553eca1ad 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -914,6 +914,11 @@ set-multi-message
   "Return recent messages as one string to display in the echo area.
 Note that this feature works best only when `resize-mini-windows'
 is at its default value `grow-only'."
+  (if (and (active-minibuffer-window) (not (minibufferp)))
+      ;; Multi-line messages are limited to one line only
+      ;; when the minibuffer window is active and not selected.
+      ;; So don't return a multi-line string in this case:
+      message
     (let ((last-message (car multi-message-list)))
       (unless (and last-message (equal message (aref last-message 1)))
         (when last-message
@@ -931,7 +936,7 @@ set-multi-message
           (setf (nthcdr multi-message-max multi-message-list) nil)))
       (mapconcat (lambda (m) (aref m 1))
                  (reverse multi-message-list)
-               multi-message-separator)))
+                 multi-message-separator))))
 
 (defun clear-minibuffer-message ()
   "Clear minibuffer message.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-12-17 18:45 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-12 18:03 bug#60015: 29.0.60; multi-line messages truncated in non-selected minibuffer Juri Linkov
2022-12-12 18:19 ` Eli Zaretskii
2022-12-12 18:37   ` Juri Linkov
2022-12-12 19:20     ` Eli Zaretskii
2022-12-13 17:20       ` Juri Linkov
2022-12-13 17:44         ` Eli Zaretskii
2022-12-13 17:56           ` Juri Linkov
2022-12-15  7:44             ` Juri Linkov
2022-12-15 10:18               ` martin rudalics
2022-12-15 13:36                 ` Eli Zaretskii
2022-12-15 14:30                   ` Eli Zaretskii
2022-12-15 15:07                     ` martin rudalics
2022-12-15 15:12                       ` martin rudalics
2022-12-15 15:30                         ` Eli Zaretskii
2022-12-15 17:35                           ` Juri Linkov
2022-12-17 17:39                           ` Juri Linkov
2022-12-17 18:45                             ` Eli Zaretskii
2022-12-15 16:44               ` Gregory Heytings
2022-12-15 17:03                 ` Eli Zaretskii
2022-12-15 17:37                   ` Juri Linkov
2022-12-15 21:52                     ` Gregory Heytings

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).