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: Sun, 28 Nov 2021 10:41:56 +0200 Message-ID: <83zgpowu23.fsf@gnu.org> References: <87ilwd7zaq.fsf.ref@yahoo.com> <87ilwd7zaq.fsf@yahoo.com> <83bl24yaed.fsf@gnu.org> <87sfvg7l51.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26332"; 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 Sun Nov 28 09:42:22 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 1mrFlO-0006hN-CX for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Nov 2021 09:42:22 +0100 Original-Received: from localhost ([::1]:51292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mrFlM-00067G-WB for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Nov 2021 03:42:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mrFkp-0005RW-Fc for emacs-devel@gnu.org; Sun, 28 Nov 2021 03:41:47 -0500 Original-Received: from [2001:470:142:3::e] (port=56164 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 1mrFkp-0004Ou-6Q; Sun, 28 Nov 2021 03:41:47 -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=n1n+sRyX5KZzyUR+DW1Q1hoT7DpF8CadUezA+Hu4u+I=; b=I6yk2c2bRkFJ iSJ1SLvcwkfgSU2+IUdrOz2AgCxXvLqxdgpyRVRwlfgYKvNURh1sbmTE5Se4NhI17lAOJQ8OIAmna gpoSCvaZRD9ImI7Sk8zJhKik+snEB9UBT8AOQLWvV6talpz+tJ4e8VIIDtTyyc5XMkoLRxqX8cNUU G8ucJTOrd6F5PD1qtC4+PUiPiK5DnIZaW/DguzFuUS1Fk2r58cyQDLWv0e0IuBdDbr1XSa3/Tzl6Y PG2wLmR/11lJB5Xi0vcmBT76MYMp+XjcJdJ729HnOxtYhl2aRxGn9siJ4wg8t8kU6NwkWAYDSZ3ni URnfgsn1IJH7X6hnF+jEbw==; Original-Received: from [87.69.77.57] (port=4757 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 1mrFko-00060Y-OS; Sun, 28 Nov 2021 03:41:47 -0500 In-Reply-To: <87sfvg7l51.fsf@yahoo.com> (message from Po Lu on Sun, 28 Nov 2021 16:13:46 +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:280389 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Sun, 28 Nov 2021 16:13:46 +0800 > > Eli Zaretskii writes: > > >> From: Po Lu > >> Date: Sun, 28 Nov 2021 11:07:57 +0800 > >> > >> I wonder what would be involved in allowing point to be outside a > >> window's visible area. > > > > Two steps: > > > > 1. Design the feature: how would it work? which operations would > > bring point back into the viewport, and which won't? For > > example, a simple question: if point is outside of the viewport, > > what is the effect of C-f or C-n on display? > > The effect would be move point forward, or to the next line, and then to > recenter the window, so point is at the center of the window. That's one possibility, perhaps the most obvious one. But it isn't the only one, and we should understand well what we want in this regard, because Emacs sometimes moves point by itself, without the user's say-so. > Inserting text should probably recenter the window as well, if point is > outside the visible area (this is also how other programs behave). This is IMO less obvious, especially if you keep in mind that text can be inserted by some Emacs command other than an explicit text insertion by the user (via self-insert-command, C-y, etc.). It is quite possible we will need some finer granularity here, where not _every_ insertion will bring point into the viewport. > This is how other programs behave as well. Emacs is much more complex than "other programs", and many commands/functions are invoked in different contexts, where user expectations regarding this aspect could be different. Moreover, we have a lot of code that disregards the context because the assumption is that point is always visible, something that is obtained by a coordinated effort of many parts of Emacs code (so if one of them doesn't make point visible, some other one will). Making this well-orchestrated effort do something different (let alone do it optionally, since I expect quite a few users to want not to have this new behavior) will probably require some new protocol.