emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60015: closed (29.0.60; multi-line messages truncated in non-selecte


From: GNU bug Tracking System
Subject: bug#60015: closed (29.0.60; multi-line messages truncated in non-selected minibuffer)
Date: Sat, 17 Dec 2022 18:46:02 +0000

Your message dated Sat, 17 Dec 2022 20:45:34 +0200
with message-id <837cyphnsh.fsf@gnu.org>
and subject line Re: bug#60015: 29.0.60; multi-line messages truncated in 
non-selected minibuffer
has caused the debbugs.gnu.org bug report #60015,
regarding 29.0.60; multi-line messages truncated in non-selected minibuffer
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
60015: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60015
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 29.0.60; multi-line messages truncated in non-selected minibuffer Date: Mon, 12 Dec 2022 20:03:41 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
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:

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.

--- End Message ---
--- Begin Message --- Subject: Re: bug#60015: 29.0.60; multi-line messages truncated in non-selected minibuffer Date: Sat, 17 Dec 2022 20:45:34 +0200
> From: Juri Linkov <juri@linkov.net>
> Cc: martin rudalics <rudalics@gmx.at>,  60015@debbugs.gnu.org
> Date: Sat, 17 Dec 2022 19:39:49 +0200
> 
> > Juri, does the patch below give good results?  It's a bit of overkill,
> > since the mini-window usually doesn't need any resizing, but maybe
> > that is not too bad.
> >
> > If it seems to solve the problem, would you please run with this for a
> > couple of weeks, and report back if you see any problems?  If there
> > are no problems, I'll then install this on the emacs-29 branch.
> >
> > diff --git a/src/xdisp.c b/src/xdisp.c
> > index d14cd46..45da496 100644
> > --- a/src/xdisp.c
> > +++ b/src/xdisp.c
> > @@ -19429,6 +19429,13 @@ redisplay_window (Lisp_Object window, bool 
> > just_this_one_p)
> >         blank_row (w, row, y);
> >       goto finish_scroll_bars;
> >     }
> > +      else if (minibuf_level >= 1)
> > +   {
> > +     /* We could have a message produced by set-minibuffer-message
> > +        displayed in the mini-window as an overlay, so resize the
> > +        mini-window if needed.  */
> > +     resize_mini_window (w, false);
> > +   }
> 
> I tested it for a while and see no problems with it.

Thanks, installed on the emacs-29 branch, and closing this bug.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]