From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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 20:45:07 +0300 Message-ID: <83eemvxbvg.fsf@gnu.org> References: <83wo0p1twr.fsf@gnu.org> <83r1qx1q9v.fsf@gnu.org> <838sd425l2.fsf@gnu.org> <83y2l3xm15.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22078"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43519@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 21 20:02:32 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 1kKQ92-0005dY-BB for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 20:02:32 +0200 Original-Received: from localhost ([::1]:53500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKQ91-0006rl-9V for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 14:02:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKPt4-0003je-SK for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 13:46:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKPt4-0000u8-I4 for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 13:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKPt4-0003Zp-Ff for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 13:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Sep 2020 17:46: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.160071031513682 (code B ref 43519); Mon, 21 Sep 2020 17:46:02 +0000 Original-Received: (at 43519) by debbugs.gnu.org; 21 Sep 2020 17:45:15 +0000 Original-Received: from localhost ([127.0.0.1]:56097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKPsJ-0003YZ-7U for submit@debbugs.gnu.org; Mon, 21 Sep 2020 13:45:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKPsF-0003YI-Ip for 43519@debbugs.gnu.org; Mon, 21 Sep 2020 13:45:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33502) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKPs9-0000fD-Tf; Mon, 21 Sep 2020 13:45:05 -0400 Original-Received: from [176.228.60.248] (port=4065 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kKPs9-0007L4-47; Mon, 21 Sep 2020 13:45:05 -0400 In-Reply-To: (message from Stefan Monnier on Mon, 21 Sep 2020 13:25:01 -0400) 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:188629 Archived-At: > From: Stefan Monnier > Cc: 43519@debbugs.gnu.org > Date: Mon, 21 Sep 2020 13:25:01 -0400 > > >> Do you know why we don't do it this way, IOW why don't we first try to > >> keep window-start unchanged and see if point ends up within view? > > Because this way we have no control on where the mini-window's display > > will start, and consequently what will be visible in the mini-window. > > Indeed, then we'll just rely on the "generic" behavior, which is > admittedly not focused on single-line (or few lines) windows, but at > least in the current case it works better (and simplifies the code > slightly). I believe the "works better" part is only guaranteed if max-mini-window-height is 1. > > In particular, if point is at EOB, redisplay could (and normally does) > > decide not to position point on the last screen line of the window, > > which means we may have some of the text not visible for no good > > reason -- not a good thing when user interaction is concerned. > > Not sure I understand what you mean. > If point is at EOB, redisplay will make sure EOB is visible. > > Or do you mean a situation like: > - minibuffer holds "foo\n" > - the mini window is a single line > - point is at EOB > In which case we'd end up displaying the empty line instead of display "foo"? Something like that. More generally, assume the text to be displayed in the mini-window is 111111111111111111 2222222222222222222222 33333333333333333333 444444444444444444444 With point in the 4th line and max-mini-window-height = 4, there's no guarantee that we will see all the 4 lines, we could see just 3 and an empty 4th one. Which means the user is shown only part of the stuff for no good reason. > AFAICT our ad-hoc scrolling code gives the same result as the generic > scrolling code in that case. Not sure what ad-hoc scrolling code you allude to here. If you mean what resize_mini_window does, then it doesn't really scroll, it just instructs redisplay to use a particular buffer position as the window-start; if that position makes point visible, redisplay will comply, and we get what we wanted: we show in the mini-window what we want to show, instead of leaving that to redisplay's whims. > I've been trying out the patch below and haven't bumped into any > surprising behavior yet, but admittedly, I probably lack creativity. IOW, you leave it entirely to the generic window-display code to select window-start based just on the value of point? And only when the mini-window cannot be enlarged enough? I wouldn't.