From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: hw 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:05:21 +0200 Message-ID: <1d287c4a1b9011bf53fe95d3dc188763b6e358f5.camel@adminart.net> References: <9d0b82c3c7bf738c47472fa908ad70daa3e9eced.camel@adminart.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40541"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) 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 18:06: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 1qQrtL-000AK8-R3 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Aug 2023 18:06:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQrso-0004wR-0h; Tue, 01 Aug 2023 12:06:03 -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 1qQrsa-0004iJ-Rm for help-gnu-emacs@gnu.org; Tue, 01 Aug 2023 12:05:52 -0400 Original-Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.160]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQrsD-0005mQ-Oy for help-gnu-emacs@gnu.org; Tue, 01 Aug 2023 12:05:36 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1690905921; cv=none; d=strato.com; s=strato-dkim-0002; b=RHX980nSoSvKFFoQ2Io197GzqO5IXX3B1PrLtjfre3pQ9EDqcwNGIQ+OgZDG0kNJJa 7YwvA4mUJapVPLcjcocZvpRJdJJRvuxUMiqOChFp60Qta2wk7FJMq4HW+7hN21j8Y9kc IQ+u9TdKio0Ah3T5VMi8EgCrYd8+Ovi+gapph2kEuy2pOrl0OUXPr4PB0T5wi715pSXd mkSZB5ZPr9k66kc+ru3gf1kxInnQuYOtwnPmovwwLZppvdTTsPBSxf/dShdH0Vxcp/M8 yqlRPL4FCJCK5fxhniN+cHgS/5sXJBxKOROoD+5tiehTKY0DKgFcAscxSVW+043ywu80 finw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1690905921; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Date:To:From:Subject:Message-ID:Cc:Date:From: Subject:Sender; bh=fFKW0eTpILOB7NaiPe5B0m6D2L0T5L/Qeg79pL5EYiY=; b=bQen3EwG5FfJnacKVf2KlX/qD0RK4htUq7VtItIcU+vjpMuW+hCKODzNgft+GHWk4n vzcg945soREA7LPWWQrA1WSh8OLx1Im7b77qQ75Go45LPTBt6ITRj1+O9R3KocPEQtAI 3zM0T+ieSgxpAGXApzL0LuUbsqJnPNwzoNmgQtTFgBHqd/VqOP+cRsUEkE9vJ4HPQedc IhxrFkpVlUhueuvECqVDQnerkbWgUx/M252F+lajbrEqzUeKqorBZkPTH1drpyS7zBEE 0byyw4HNXk4bDZ3Erog6RMahw6JH8Jn0oVmTlGr5tGnRhX3+yM7hVq1CjyVwqn5mbMKu D+nA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1690905921; s=strato-dkim-0002; d=adminart.net; h=References:In-Reply-To:Date:To:From:Subject:Message-ID:Cc:Date:From: Subject:Sender; bh=fFKW0eTpILOB7NaiPe5B0m6D2L0T5L/Qeg79pL5EYiY=; b=qwHk0DahzletLel8ooxFIzxyxGUzNo8tv/b48gzPKhO34HHGpi5cKUN1REPmL1EeKz VRmFUfleIN7FzOvjbF+tq2YhA+NBKPFG6QeS6ZQCCtQuGMytL4nrNTOURlRNHRYewhd9 09sA6f4DuWI/PO6EA8fQUW94XQDaQh7pc04oWLOCvRM0MKf4B1oJPJ7fSc0zAAjpZ2+e 0R6X7iRsYoU52BT4sWnwJKwgPC/7zZUhX6JV6nBXP1ZrHF2CEUcXxwLffwHO7x9dZkEl 70GxJKq6CkzxTzh4zybpFEeJeBxAAlbi8FWiTU5DWPAj6XutkljamUN16f3MVThrE74J l96Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1690905921; s=strato-dkim-0003; d=adminart.net; h=References:In-Reply-To:Date:To:From:Subject:Message-ID:Cc:Date:From: Subject:Sender; bh=fFKW0eTpILOB7NaiPe5B0m6D2L0T5L/Qeg79pL5EYiY=; b=Cuz0yXqHULrAjwzV3nG++yRKMjAi4l96/iz1KLeF/7WH9gNjkphPiRuK77IXaKJUXX 6kMZd+Jpjb358l1dG6Bw== X-RZG-AUTH: ":O2kGeEG7b/pS1Ey9Rna9iAZFrfz26y6zbtmqiE/f0+UVPWzfkhbRoUzSCTTNnjIupuXQshKqSG7HgphPv/kc/YeRUrW7Q+K30FhwK6zFf7Z8m4qs" Original-Received: from [IPv6:2a09:8e40:1122:f400:f177:7f3c:18f2:8e66] by smtp.strato.de (RZmta 49.6.6 AUTH) with ESMTPSA id Qbac0bz71G5LWrf (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Tue, 1 Aug 2023 18:05:21 +0200 (CEST) In-Reply-To: Received-SPF: none client-ip=81.169.146.160; envelope-from=hw@adminart.net; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:144535 Archived-At: On Tue, 2023-08-01 at 10:45 -0400, Spencer Baugh wrote: > hw writes: > > On Mon, 2023-07-31 at 16:18 -0400, Spencer Baugh wrote: > > > After I use scroll-up or scroll-down, I want to start reading the new > > > text on the screen. But it's easy to lose track of where the new tex= t > > > start, especially with larger values of next-screen-context-lines. > > >=20 > > > So, I would like scrolling to move point to the division between old = and > > > new text. Then the location of the cursor will help me keep track of > > > which text is new and which text is old. > > >=20 > > > Concretely, this means scroll-up should put point at the beginning of > > > the new text (and therefore at the end of the old text), and scroll-d= own > > > should put point at the end of the new text (and therefore at the > > > beginning of the old text). > > >=20 > > > Is this possible? > >=20 > > Maybe try the following: > >=20 > >=20 > > (setq scroll-preserve-screen-position t) > > (setq scroll-conservatively 0) > > (setq scroll-margin 1) > >=20 > >=20 > > With this, I can see point and that is where the text scrolls to. >=20 > No, I don't think this does what I said at all, I'm afraid. Are you actually using scroll-down and scroll-up or scroll-down-command and scroll-up-command? IIUC the documentation of scroll-down, when setting =E2=80=98next-screen-context-lines=E2=80=99 to zero, scroll-down would scro= ll the contents of the buffer up such that the first line of new text would be at the top of the window. You could then (somehow) move point to the top of the window, which would put it into the first line of the new text. Scroll-up could be done accordingly. For either direction, it would make sense to have the new text always start at the top of the window because the text always needs to be within the window to be read. And you somehow need to define where on the screen you want to start reading the new text. If you want to start reading at point, you may not be able to read new text after scrolling down when point is in the bottom line of the window because the new text would have to remain outside the window. Same goes for scrolling up when mark is in the top line of the buffer. Do you need to start reading where the mark is, or does it suffice when the new text always starts of the top the window? If you need to start reading at point, perhaps you can create a function that figures out how many lines are between point and the last/first line in the window and scrolls the text only so many lines as to bring the first line of the new text to where point is. I don't know if that's possible ... > > > Alternative suggestions for how I can keep track of what text is new = on > > > screen after scrolling are also appreciated. > > >=20 > > > I think I only want this for scroll-{up,down} and > > > scroll-other-window{,-down} but possibly it would make sense for othe= r > > > commands which I don't know. > > >=20 > > > (I would file a bug requesting this feature, but scrolling is so > > > fundamental that perhaps this is already supported by some combinatio= n > > > of features which I don't know) > >=20 > > Have you tried scroll-lock-mode? >=20 > Yes, it's nice, but I also want the normal scroll-{up,down} commands to > work. >=20 > I think scroll-lock-mode could do with a more convenient default > binding, also. A lot of programmers, including me, have keyboards which > don't have a scroll lock key... A keyboard without a ScrollLock key? That's very strange indeed.