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: Mon, 06 Dec 2021 16:13:37 +0200 Message-ID: <83mtld254e.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> <83h7bo5m1x.fsf@gnu.org> <87ilw3ubfp.fsf@yahoo.com> <83h7bn4e55.fsf@gnu.org> <877dcipjmk.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22263"; 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 Mon Dec 06 15:14:37 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 1muElI-0005UF-Rt for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 15:14:37 +0100 Original-Received: from localhost ([::1]:54482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muElH-0007NA-Oh for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 09:14:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muEkO-0005hK-IR for emacs-devel@gnu.org; Mon, 06 Dec 2021 09:13:42 -0500 Original-Received: from [2001:470:142:3::e] (port=53364 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 1muEkO-0000vi-AK; Mon, 06 Dec 2021 09:13:40 -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=JkUtZRaNYVDUjbn1MkZyZpetgFsuL3Uvc95Gzb/u/Ns=; b=cNqpZoZpCjlb cR2ryk2CJRaCbqPEcHv/Lji8hzhIPJ93qD8ZnL+XQNbfa9uGHtEhwHk0IcCEjuJWlf7TEb5IbYFyd q5x1dIb0TNqwSWrIg5CIXTRB4h4zCv1EW+usQPjYm7Q/MA3JiziKia7OtE/bfv+z1OgpZEmdZ+Z3X eRJOmi94GqublZIrzO2+HPWUZaC9M+CLEqWCrn7xSpJywoNBJppX+p455E2nCn+88a4xSULJbCDJS KP9nJfBzHlgpyh9NesRu3kXu6J/k500SkcolCWDhhpExtooaEiyi6FqsmuQ4plVzH+4T6cKYUpnZH UtGsVwEDkHhcVZTrsZJHVg==; Original-Received: from [87.69.77.57] (port=2710 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 1muEkN-00062G-V5; Mon, 06 Dec 2021 09:13:40 -0500 In-Reply-To: <877dcipjmk.fsf@yahoo.com> (message from Po Lu on Mon, 06 Dec 2021 10:11:47 +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:281116 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Mon, 06 Dec 2021 10:11:47 +0800 > > > That'd cover scrolling a window in a way that leaves point outside of > > it. But Emacs also sets the window-start position in other > > situations. Moreover, the display engine itself does that, see > > redisplay_window. > > > So some logic and/or flags will be needed to distinguish between the > > cases. > > We should not recenter the display in any case where the start is not > forced and point is not moved. Again, what do you mean by "start is forced"? Emacs sometimes forces the window-start upon itself, you can clearly see that in the code. And if point is outside of the window, recentering makes no sense anyway, because there's nothing to recenter about, there's no point of reference for it. > > So any change in the numerical value of point will scroll the window > > to bring point into the view? That'd be fine if that's what users > > expect. But do they? E.g., what happens if point is below the > > window, and you paste (with the mouse) some text into the visible > > portion of the window (which doesn't show point)? > > That's not a problem, as `mouse-yank-primary' and friends already call > mouse-set-point. "Not a problem" because point will be brought back into the window before pasting? But is that what users want? > WDYT about the attached patch? It recenters the display whenever PT != > w->last_point, and it seems to work very well. > > It also introduces a new variable `scroll-move-point' that controls if > the scrolling commands will try to move point to stay visible. Thanks, I will look into this later.