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.help Subject: Re: Make scroll-{up, down} move point to {start, end} of newly visible text Date: Thu, 24 Aug 2023 07:43:15 +0300 Message-ID: <83r0ntqcd8.fsf@gnu.org> References: <83il9y22e8.fsf@gnu.org> <834jli1uhb.fsf@gnu.org> <83msz7wez5.fsf@gnu.org> <87h6pcj5x1.fsf@dataswamp.org> <83y1iln1up.fsf@gnu.org> <87wmy4lyol.fsf@dataswamp.org> <837cq2iyyw.fsf@gnu.org> <87zg2yu600.fsf@dataswamp.org> <838rahhl4s.fsf@gnu.org> <87bkfdkbzo.fsf@dataswamp.org> <83ttt5fmmn.fsf@gnu.org> <87h6p5ieog.fsf@dataswamp.org> <83cyzse69j.fsf@gnu.org> <877cq0l1e9.fsf@dataswamp.org> <834jl3cc0a.fsf@gnu.org> <87o7j2bcxb.fsf@dataswamp.org> <838ra3tg4g.fsf@gnu.org> <871qfu986m.fsf@dataswamp.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36637"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 06:43:36 2023 Return-path: Envelope-to: geh-help-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 1qZ2Bz-0009NB-5N for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 06:43:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ2BK-0008Tq-BA; Thu, 24 Aug 2023 00:42:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZ2BI-0008TY-2s for help-gnu-emacs@gnu.org; Thu, 24 Aug 2023 00:42:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZ2BH-0002A1-R1 for help-gnu-emacs@gnu.org; Thu, 24 Aug 2023 00:42:51 -0400 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=f+5d9CmC5Ov/PC+V7pvafMQTuMISjWJUQ8F4cFH0oQQ=; b=cOYkg6u+IZ/Q 4C+Sq+xcAOHe4C2HndvDbpZxFYhMLPYQKnst7CX+ACL2MDrBm+W0BT9S6PRjD5Tl/xjZ/+3ikZmnL fXtWFeaHugGa4515bWmHzSYZAU1ILrDp7Uu4ZHHWvfsCk+Q650SqbVwcbvkBtjsBmfaPuG1XgMZzO 5+CtXCk3wX4y6RBJDfo4scnXnDMeJwfhdE1u2/+vmSkaUDOVXGCXfH3yQD4qrJ+y6VZRT3c3Lvz5S U7QirDZFmZdWhBe5YeXPhjQwTapq6D52weT1GPR7a3n6sm8E6dznJUjXLb7Ks9W6wWZIyI2ofhmqV 1K1A3t+LmRz7GA68baE9Ag==; In-Reply-To: <871qfu986m.fsf@dataswamp.org> (message from Emanuel Berg on Tue, 22 Aug 2023 21:41:05 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:144946 Archived-At: > From: Emanuel Berg > Date: Tue, 22 Aug 2023 21:41:05 +0200 > > Eli Zaretskii wrote: > > >> No, for example, by opening this very buffer, Emacs already > >> knows its state, since it displays "All" in the mode bar (and > >> I didn't scroll). > >> > >> So it is already there. Somewhere! > > > > Yes, but _after_ the display, not before. > > It is available before scrolling, like now it says 4%. > The next time I execute a scroll function by hitting a key, > that function could look at that data and use it to determine > if scrolling should take place, and only then do it. You once again lost the context. Your proposed solution required to have this information _after_ the scroll command, to know where the display will end up after performing the scrolling. For that purpose, it is not very useful to know where you are _before_ scrolling. > Just now I'm scrolling some more, and now it says "Bottom" in > the mode bar instead. I am able to scroll more, but the > function I describe would in this, changed situation see that > it already is at the bottom and therefore not scroll. These indications are updated after two things happen, one after the other: . the scroll command determines where to locate the window-start position . the following redisplay cycle actually scrolls the text to obey what the scroll command determined, determines the window's end position, and updates the mode-line indication like "Bottom" Your proposed solution was to inject some logic _between_ those two, and the position of the end of the window is not yet known at that point.