summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2019-12-30 18:00:17 +0200
committerEli Zaretskii <eliz@gnu.org>2019-12-30 18:00:17 +0200
commite3ec84fd7d91c9fff756e28d14ce33f7a37ac19f (patch)
treedc88edcf9bbbddbd7ce22c3b7426febc2808c48f /src/keyboard.c
parent450633f85ae336e8a23241ec3ca5de5d8de8dcdd (diff)
downloademacs-e3ec84fd7d91c9fff756e28d14ce33f7a37ac19f.tar.gz
emacs-e3ec84fd7d91c9fff756e28d14ce33f7a37ac19f.tar.bz2
emacs-e3ec84fd7d91c9fff756e28d14ce33f7a37ac19f.zip
Ensure mini-window is resized to show active minibuffer contents
* src/keyboard.c (read_char, command_loop_1): Resize the mini-window after clearing the echo area while minibuffer is active. (Bug#38645)
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 4cf1f64b487..cb311efd7e5 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 command_loop_1. */
+ && !NUMBERP (Vminibuffer_message_timeout))
+ resize_mini_window (XWINDOW (minibuf_window), false);
}
else if (FUNCTIONP (Vclear_message_function))
clear_message (1, 0);