all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: ynyaaa@gmail.com, 38645@debbugs.gnu.org
Subject: bug#38645: 26.3; minibuffer input is called with multi-line window when multi-line message is shown
Date: Sun, 29 Dec 2019 16:15:28 +0200	[thread overview]
Message-ID: <83a77bnrpb.fsf@gnu.org> (raw)
In-Reply-To: <e994a9d1-8f20-5599-b94c-42a02bcb28ce@gmx.at> (message from martin rudalics on Fri, 27 Dec 2019 10:12:33 +0100)

> Cc: 38645@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
> Date: Fri, 27 Dec 2019 10:12:33 +0100
> 
>  > Martin, what do you think about the following fix?  Is it correct, and
>  > if so, safe enough for the release branch?
> 
> It seems "correct" in the sense that our doc of 'resize-mini-windows'
> nowhere contradicts any such interpretation.  It should be "safe" in
> the sense that failing to always resize the minibuffer window exactly
> and falling back on 'grow-only' should not do any harm since otherwise
> we'd have a bug in the 'grow-only' part of the code.
> 
> But I'm too silly to understand why the minibuffer window does not
> re-grow in the first place after having shown the result of C-x C-e.
> Can you enlighten me?

I hope the following alternative patch will answer that question.
Comments are welcome.

diff --git a/src/keyboard.c b/src/keyboard.c
index 4cf1f64b48..a04f1f77de 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1318,6 +1318,11 @@ command_loop_1 (void)
 	  message1 (0);
 	  safe_run_hooks (Qecho_area_clear_hook);
 
+	  /* We cleared the echo area, and the minibuffer will now
+	     show, so resize the mini-window in case the minibuffer
+	     needs more or less space than the echo area.  */
+	  resize_mini_window (XWINDOW (minibuf_window), false);
+
 	  unbind_to (count, Qnil);
 
 	  /* If a C-g came in before, treat it as input now.  */
@@ -2989,6 +2994,16 @@ read_char (int commandflag, Lisp_Object map,
 	{
 	  safe_run_hooks (Qecho_area_clear_hook);
 	  clear_message (1, 0);
+	  /* If we were showing the echo-area message on top of an
+	     active minibuffer, resize the mini-window, since the
+	     minibuffer may need more or less space than the echo area
+	     we've just wiped.  */
+	  if (minibuf_level
+	      && EQ (minibuf_window, echo_area_window)
+	      /* The case where minibuffer-message-timeout is a number
+		 was already handled near the beginning of this function.  */
+	      && !NUMBERP (Vminibuffer_message_timeout))
+	    resize_mini_window (XWINDOW (minibuf_window), false);
 	}
       else if (FUNCTIONP (Vclear_message_function))
         clear_message (1, 0);





  parent reply	other threads:[~2019-12-29 14:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17  6:49 bug#38645: 26.3; minibuffer input is called with multi-line window when multi-line message is shown ynyaaa
2019-12-17  7:41 ` Eli Zaretskii
2019-12-17 11:55 ` ynyaaa
2019-12-17 12:07   ` Eli Zaretskii
2019-12-18 10:52     ` ynyaaa
2019-12-18 16:31       ` Eli Zaretskii
2019-12-20  2:16         ` ynyaaa
2019-12-26 20:49           ` Eli Zaretskii
2019-12-27  9:12             ` martin rudalics
2019-12-27  9:21               ` Eli Zaretskii
2019-12-27  9:46                 ` martin rudalics
2019-12-27 10:29                   ` Eli Zaretskii
2019-12-29 14:15               ` Eli Zaretskii [this message]
2019-12-29 18:33                 ` martin rudalics
2019-12-29 18:50                   ` Eli Zaretskii
2019-12-29 19:30                     ` martin rudalics
2019-12-30 16:07                       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a77bnrpb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=38645@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    --cc=ynyaaa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.