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: Tue, 01 Aug 2023 18:44:31 +0300 Message-ID: <83il9y22e8.fsf@gnu.org> References: <83mszb0w9l.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6471"; 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 Tue Aug 01 17:45:12 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 1qQrYb-0001RB-Rp for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Aug 2023 17:45:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQrXw-00010m-RQ; Tue, 01 Aug 2023 11:44:28 -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 1qQrXu-00010Z-UP for help-gnu-emacs@gnu.org; Tue, 01 Aug 2023 11:44:27 -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 1qQrXu-0003iJ-Kj for help-gnu-emacs@gnu.org; Tue, 01 Aug 2023 11:44:26 -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=POT7GuNVPVYDSoz/QcF8Ysp1NcdeAiCd57j/lCmnczU=; b=N0g90GZ0QSIC 9E3M4IXOBi/ZpcfAR31nFweEFqJV7J4F5f3V0COOLUXrSKR1/+JNyRrpSb8nUa/+KBwoWPpqh2rbb 9IrjXe7udlZY3BQ73Ng4Byi5BA0+2BAnXAdWMOEjgdHmkWMiVh6OZCGJc4Gva72ErEyPqQgoETg1M A4EBsyxyVCnaVxtOa+U46qk2k7m+MxohCFA6W6i/Ady3jTCtZjZ6caLFVLPytzAHBIB/VZXuGkBQW jBxhPkFsHRvLQKgv09xqbtx4opu+mG6cnyT+4R3BE8zWa49+ui7u7rrccYJENi8v3SJoSPFgZAUne MFslYEAKxRRprYoLumgdag==; Original-Received: from [87.69.77.57] (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 1qQrXu-0005eg-3j for help-gnu-emacs@gnu.org; Tue, 01 Aug 2023 11:44:26 -0400 In-Reply-To: (message from Spencer Baugh on Tue, 01 Aug 2023 10:50:48 -0400) 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:144533 Archived-At: > From: Spencer Baugh > Date: Tue, 01 Aug 2023 10:50:48 -0400 > > Eli Zaretskii writes: > > > If by "new text start" you mean the first line that was not visible in > > the window before C-v, then set scroll-margin to the value of > > next-screen-context-lines, and then Emacs will put point at that first > > new line. > > > > Is that what you want? > > Yes, that's exactly what I mean and want! Perfect, and very clever! > That indeed moves point to the division between old and new text! > > Ah, but there's a missing feature... I'd like it to also work as I > described when I use scrolling with a prefix argument. That is, it > should move point to the division between old and new text even then. > > So M-5 C-v would move point to 5 lines from the end of the buffer. > scroll-margin might interfere, but I still would want point to be at the > division between old and new text. When you scroll by a small number of lines, Emacs generally doesn't move point at all, unless it has to. And in that case, what exactly is "new text"? it's basically undefined. IOW, scrolling by single lines or a small number of lines is very similar to scrolling with down-arrow or up-arrow, and those already behave like you want. So why not use arrows instead?