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.devel Subject: Re: Allowing point to be outside the window? Date: Sat, 04 Dec 2021 18:24:13 +0200 Message-ID: <83mtlg5oeq.fsf@gnu.org> References: <87ilwd7zaq.fsf.ref@yahoo.com> <87ilwd7zaq.fsf@yahoo.com> <83bl24yaed.fsf@gnu.org> <87sfvg7l51.fsf@yahoo.com> <83zgpowu23.fsf@gnu.org> <87zgpo5tws.fsf@yahoo.com> <83pmqkwi6r.fsf@gnu.org> <87v90c5su6.fsf@yahoo.com> <83o864wg2a.fsf@gnu.org> <87ilwb68ck.fsf@yahoo.com> <83zgpnunfo.fsf@gnu.org> <87fsrf3xmd.fsf@yahoo.com> <83y257ulfp.fsf@gnu.org> <8735ne4e0e.fsf@yahoo.com> <87czmcvcs1.fsf@yahoo.com> <83sfv85y36.fsf@gnu.org> <87v904tsvv.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10611"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 04 17:25:29 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mtXqr-0002ad-GU for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Dec 2021 17:25:29 +0100 Original-Received: from localhost ([::1]:37918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtXqp-0001TS-W4 for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Dec 2021 11:25:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtXpl-0000my-7U for emacs-devel@gnu.org; Sat, 04 Dec 2021 11:24:21 -0500 Original-Received: from [2001:470:142:3::e] (port=38256 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtXpk-0000mU-Vr; Sat, 04 Dec 2021 11:24:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KONQE1/UrQOUrCuuBmd8m5isOSleR9jxCBr+8DB97IQ=; b=d8AwdFSXWNpb yVm9Oye0cu1gl/+ahXIs+/USBCl17eJs828n+vDNOxGmHbvZ/SOFj9SSvryZzAgMogq90G1bLyw+9 PD9v/wRSts/Z2/uzyJOvEp1HDY/CzISqI2y1bSzM0AArz9EUgZzEZMFEffA2ieL1P0/lIz5B5MvMx HEVzbwn+x1VI07YgRdeXOJ/q7GAKOtL6ayoydD8O5fuEM/EIbBY8guQBYGYHliwZnxhuv5ZtoNHX2 cXAYcDGRvJTJF90TZwX3WZlRzvmcuyisZkhqzXgUXl9NMcEJajP3HoY8Va0MqbcEybFqQlcbaG65Q f4AZd73Owct1DcbJ041++w==; Original-Received: from [87.69.77.57] (port=3601 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtXpk-0003lC-P1; Sat, 04 Dec 2021 11:24:21 -0500 In-Reply-To: <87v904tsvv.fsf@yahoo.com> (message from Po Lu on Sat, 04 Dec 2021 21:13:40 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:280924 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Sat, 04 Dec 2021 21:13:40 +0800 > > > This "allows point to be outside a window" in what situations? > > If you move point out of the visible area of the window (such as with > `goto-char') or if you set the window start but do not force it. Which commands did you try in addition to goto-char? What about scrolling commands? > > Shouldn't set_cursor_from_row be disabled/bypassed in this mode? > > > > And I don't understand the dance with the cursor_visible_p flag: why > > do you reset it at entry and set back before exiting? Isn't the value > > of w->cursor enough to tell whether the cursor position was computed > > or not? > > The idea is that if `set_cursor_from_row' returns false (say if the > cursor was not found to be in the row), w->cursor_visible will also be > set to false. But you are just wasting cycles that way. When it is known that point is outside of the window, that function will end up being called for every screen line we lay out. Instead, just set the result without calling it in those cases. > I don't understand why set_cursor_from_row should be disabled though: > isn't it responsible for placing the cursor on the display (and as such, > isn't it required for the cursor to be displayed when point is _inside_ > the window?). Yes. I meant when you know that point is outside of the window. > > I don't understand this change. Are you forcibly trying to avoid > > calling try_scrolling? If so, why? That function is only loosely > > related to scrolling commands; in fact, if you type C-v in "emacs -Q", > > you will never see it called. This function is an optimization of a > > window's redisplay, and that is needed even in this new mode you are > > implementing. > > Doesn't `try_scrolling' try to constrain point inside if it is too near > the end of the window? Among other things, yes. But its main purpose is not to move point, it's to find a suitable window-start position. > (And isn't the optimization that tries to decide whether or not to > blit the display if appropriate `scrolling_window' in dispextern.c?) scrolling_window belongs to the second phase of a redisplay cycle, where we actually deliver glyphs to the glass. try_scrolling is from the first phase, where we decide what should be on the glass. In any case, both try_scrolling and scrolling_window are not about bringing point back into view, they are about redrawing the window so that it correctly reflects the buffer contents. So these functions cannot and shouldn't be bypassed, even in this mode. > > The condition above doesn't check the keep_point_visible flag, why? > > w->cursor_visible_p should always be true if keep_point_visible is not > nil by the time we get there. There should be a comment there about this, and perhaps also an assertion.