From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#4534: assertion failure at window.c:grow_mini_window Date: Thu, 24 Sep 2009 08:49:30 +0200 Message-ID: <4ABB167A.4070801@gmx.at> References: <4AB9CE11.9040300@gmx.at> <4ABA12BF.8070205@gmx.at> Reply-To: martin rudalics , 4534@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253776218 16876 80.91.229.12 (24 Sep 2009 07:10:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 07:10:18 +0000 (UTC) Cc: 4534@emacsbugs.donarmstrong.com To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 24 09:10:11 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqiSp-0001rk-Hp for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 09:10:03 +0200 Original-Received: from localhost ([127.0.0.1]:59500 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqiSo-00028A-W5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Sep 2009 03:10:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqiS8-0001tY-Ih for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 03:09:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqiS5-0001pv-1u for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 03:09:20 -0400 Original-Received: from [199.232.76.173] (port=52218 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqiS4-0001pZ-Hw for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 03:09:16 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:9066) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MqiS3-0004jT-Sy for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 03:09:16 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqiS3-00061N-75 for bug-gnu-emacs@gnu.org; Thu, 24 Sep 2009 03:09:15 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8O773ml026655; Thu, 24 Sep 2009 00:07:04 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8O6tE4E024395; Wed, 23 Sep 2009 23:55:14 -0700 Resent-Date: Wed, 23 Sep 2009 23:55:14 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 24 Sep 2009 06:55:14 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4534 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4534-submit@emacsbugs.donarmstrong.com id=B4534.125377497923591 (code B ref 4534); Thu, 24 Sep 2009 06:55:14 +0000 Original-Received: (at 4534) by emacsbugs.donarmstrong.com; 24 Sep 2009 06:49:39 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with SMTP id n8O6nbA9023588 for <4534@emacsbugs.donarmstrong.com>; Wed, 23 Sep 2009 23:49:38 -0700 Original-Received: (qmail invoked by alias); 24 Sep 2009 06:49:31 -0000 Original-Received: from 62-47-53-69.adsl.highway.telekom.at (EHLO [62.47.53.69]) [62.47.53.69] by mail.gmx.net (mp069) with SMTP; 24 Sep 2009 08:49:31 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/c00cK1mDcWyjcH2Cje4aXku93dxu/U7HKKiSY8B rCowH1LFCvTL0k User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6 X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Thu, 24 Sep 2009 03:09:20 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31440 Archived-At: >> Would writing >> >> if (height > WINDOW_TOTAL_LINES (w)) >> { >> freeze_window_starts (f, 1); >> grow_mini_window (w, height - WINDOW_TOTAL_LINES (w)); >> } >> >> instead do better? > > In my case, height < WINDOW_TOTAL_LINES (w) at that point (that's what > triggers the xassert), so adding the above check works exactly like > removing the if() altogether: it does not crash, but it does not > shrink the minibuffer to 5 lines, which would be the correct height. Seems I'm too silly to understand what's going on in resize_mini_window. Apparently if (EQ (Vresize_mini_windows, Qgrow_only)) ... fails so ... else ... gets executed ... { /* Always resize to exact size needed. */ if (height > WINDOW_TOTAL_LINES (w)) ... fails again, so ... else if (height < WINDOW_TOTAL_LINES (w)) ... we're here ... { int old_height = WINDOW_TOTAL_LINES (w); freeze_window_starts (f, 0); shrink_mini_window (w); ... should resize the mini_window down to one line ... if (height) { freeze_window_starts (f, 1); ... and the following causes the assertion failure to trigger because the second arguments gets less than zero ... grow_mini_window (w, height - WINDOW_TOTAL_LINES (w)); } window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height; } } Now if I replace the check if (height) by if (height > WINDOW_TOTAL_LINES (w)) I should be able to avoid the delta = -1 assertion failure in grow_mini_window. Can you confirm my reasoning so far? The fact that `height' is something like zero or less seems to stem from some miscalculation (probably caused by the line-wrapping part) earlier in the code of resize_mini_window. If that's so could you try to find out why height is not at least one line? martin