From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#43519: 28.0.50; Overlay at end of minibuf hides minibuf's real content Date: Mon, 21 Sep 2020 14:18:07 +0000 Message-ID: References: <83wo0p1twr.fsf@gnu.org> <83r1qx1q9v.fsf@gnu.org> <838sd425l2.fsf@gnu.org> <83363bz0r0.fsf@gnu.org> Reply-To: Gregory Heytings Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7722"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.22 (NEB 394 2020-01-19) Cc: monnier@iro.umontreal.ca, 43519@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 21 16:19:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kKMev-0001rx-1h for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 16:19:13 +0200 Original-Received: from localhost ([::1]:45668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKMeu-0004V7-3D for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 10:19:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKMel-0004Sx-AF for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 10:19:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44014) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKMek-0001t4-AM for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 10:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKMek-0006W4-6w for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 10:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Sep 2020 14:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43519 X-GNU-PR-Package: emacs Original-Received: via spool by 43519-submit@debbugs.gnu.org id=B43519.160069789424988 (code B ref 43519); Mon, 21 Sep 2020 14:19:02 +0000 Original-Received: (at 43519) by debbugs.gnu.org; 21 Sep 2020 14:18:14 +0000 Original-Received: from localhost ([127.0.0.1]:55560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKMdx-0006Uy-RV for submit@debbugs.gnu.org; Mon, 21 Sep 2020 10:18:14 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:54854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKMdv-0006Un-9T for 43519@debbugs.gnu.org; Mon, 21 Sep 2020 10:18:12 -0400 Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 08LEIAhE006166 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 21 Sep 2020 14:18:10 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 08LEINvQ016464; Mon, 21 Sep 2020 14:18:23 GMT In-Reply-To: <83363bz0r0.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188587 Archived-At: > > I believe using window-text-pixel-size (which I already mentioned > several times) will avoid any such difficulties, since that function > takes all of those complications into account. Therefore, I still don't > understand why this approach is not being explored more actively. > This I don't know or understand either. My guess is that creating a candidate list by adding one candidate at a time and checking with window-text-pixel-size if the result is too large would be inefficient. This could be improved with a kind of binary search of course. >> it is true that in all of these situations starting the mini-window >> display at BOB would do the right thing. > > Are you sure? What if the prompt is longer than a screen line (i.e., > the prompt itself is continued on the 2nd and subsequent screen lines)? > If the prompt is long, but the list of candidates is short, starting the > mini-window display at BOB might fail to show some or all of the > candidates, because the long prompt uses up most or all of the > mini-window screen estate. > Yes I'm sure. In the case you mention indeed some candidates will not be displayed, but that's not a problem because most of the time all candidates are not displayed anyway. Of course there is the case when the prompt is, say, two characters less than the mini-window width, in which case no candidates will be displayed (if the user has (setq max-mini-window-width 1)), but this is unlikely to happen, and the default value of max-mini-window-width is 0.25 anyway. >>> IOW, the basic logic is to show the last max-mini-window-height screen >>> lines of what's in mini-window. >> >> Yes, and this is not desirable in certain cases, it should be possible >> to show the *first* max-mini-window-height screen lines of what's in >> mini-window. > > Showing the last part is in general a better strategy in the use cases > relevant to the mini-window, which are about user interaction. > In general yes, but not when displaying completion candidates with an overlay at EOB, with the point before the overlay text. In that case you start with a blinking cursor at the top left of the minibuffer, without any indication of what you are doing or should do. > > I believe you assume that starting at BOB still shows enough of the text > to allow the user to interact intelligently, but those are not the only > cases we should keep in mind, since the prompt doesn't have to be short > enough for that assumption to be true. > I tested this, and it works, even with overlong prompts. In that case (for example with (setq max-mini-window-width 1) and a prompt wider than the mini-window width) the prompt disappears, but this is expected, and it's a corner case that almost never happens. Moreover when displaying completion candidates you don't start with a long prompt (except, again, in corner cases).