From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38791: 27.0.60; Multiline mini-window fails to resize after clearing message Date: Sun, 29 Dec 2019 16:27:15 +0200 Message-ID: <838smvnr5o.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="210949"; mail-complaints-to="usenet@blaine.gmane.org" To: 38791@debbugs.gnu.org, rudalics@gmx.at Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 29 15:28:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ilZYC-000skX-Ga for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Dec 2019 15:28:12 +0100 Original-Received: from localhost ([::1]:52486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilZYB-0005bO-4W for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Dec 2019 09:28:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilZY4-0005b0-09 for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2019 09:28:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilZY2-00007s-MY for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2019 09:28:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53432) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ilZY2-00006O-Ha for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2019 09:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ilZY2-0005Ei-BT for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2019 09:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Dec 2019 14:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38791 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org, martin rudalics Original-Received: via spool by submit@debbugs.gnu.org id=B.157762963620060 (code B ref -1); Sun, 29 Dec 2019 14:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Dec 2019 14:27:16 +0000 Original-Received: from localhost ([127.0.0.1]:59402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZXH-0005DU-RJ for submit@debbugs.gnu.org; Sun, 29 Dec 2019 09:27:16 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZXG-0005DN-Je for submit@debbugs.gnu.org; Sun, 29 Dec 2019 09:27:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43777) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilZXF-0005ZR-6w for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2019 09:27:14 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:48050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ilZXE-0004kc-Sy; Sun, 29 Dec 2019 09:27:12 -0500 Original-Received: from [176.228.60.248] (port=4452 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ilZXE-0008AD-AG; Sun, 29 Dec 2019 09:27:12 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173889 Archived-At: To reproduce from "emacs -Q": . Turn off global-eldoc-mode, which triggers redisplay and can hide this bug: M-x global-eldoc-mode RET . Set resize-mini-windows to t. . Type into *scratch*: (message "a\nb\nc") and press "C-x C-e" to evaluate the call to 'message'. This will show a 3-line message in the echo area, and the mini-window will resize to show all the 3 lines. . Press any key, for example C-b. This clears the echo area, but the mini-window is not resized back to a single line, although the value of resize-mini-windows is t. This is a regression, because in Emacs 26 this works as expected. The patch to fix this is below. It reverts a small part of commit 8e0ebb9, which inadvertently changed the logic in grow_mini_window. The problem in this case was that old_height + delta evaluated to zero, but instead of limiting the result to the equivalent of 1 line, the code did nothing. diff --git a/src/window.c b/src/window.c index c52a8ca285..1962e07f8d 100644 --- a/src/window.c +++ b/src/window.c @@ -5229,10 +5229,15 @@ grow_mini_window (struct window *w, int delta) { struct frame *f = XFRAME (w->frame); int old_height = window_body_height (w, true); + int min_height = FRAME_LINE_HEIGHT (f); eassert (MINI_WINDOW_P (w)); - if ((delta != 0) && (old_height + delta >= FRAME_LINE_HEIGHT (f))) + /* Never shrink mini-window to less than its minimum height. */ + if (old_height + delta < min_height) + delta = old_height > min_height ? min_height - old_height : 0; + + if (delta != 0) { Lisp_Object root = FRAME_ROOT_WINDOW (f); struct window *r = XWINDOW (root); In GNU Emacs 27.0.60 (build 15, i686-pc-mingw32) of 2019-12-29 built on HOME-C4E4A596F7 Repository revision: aa0c679f484347d20ab6f7c0f75f32f5e360cb89 Repository branch: emacs-27 Windowing system distributor 'Microsoft Corp.', version 5.1.2600 System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600) Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure -C --prefix=/d/usr --with-wide-int --with-modules --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-4 -g3'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2 HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS MODULES THREADS JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 50621 11136) (symbols 48 7172 1) (strings 16 18826 2216) (string-bytes 1 531767) (vectors 16 9418) (vector-slots 8 126838 7876) (floats 8 21 333) (intervals 40 258 20) (buffers 888 11))