unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: hw <hw@adminart.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Make scroll-{up, down} move point to {start, end} of newly visible text
Date: Tue, 01 Aug 2023 18:05:21 +0200	[thread overview]
Message-ID: <1d287c4a1b9011bf53fe95d3dc188763b6e358f5.camel@adminart.net> (raw)
In-Reply-To: <ier1qgmbz4c.fsf@janestreet.com>

On Tue, 2023-08-01 at 10:45 -0400, Spencer Baugh wrote:
> hw <hw@adminart.net> 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 text
> > > start, especially with larger values of next-screen-context-lines.
> > > 
> > > 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.
> > > 
> > > 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-down
> > > should put point at the end of the new text (and therefore at the
> > > beginning of the old text).
> > > 
> > > Is this possible?
> > 
> > Maybe try the following:
> > 
> > 
> > (setq scroll-preserve-screen-position t)
> > (setq scroll-conservatively 0)
> > (setq scroll-margin 1)
> > 
> > 
> > With this, I can see point and that is where the text scrolls to.
> 
> 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
‘next-screen-context-lines’ to zero, scroll-down would scroll 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.
> > > 
> > > I think I only want this for scroll-{up,down} and
> > > scroll-other-window{,-down} but possibly it would make sense for other
> > > commands which I don't know.
> > > 
> > > (I would file a bug requesting this feature, but scrolling is so
> > > fundamental that perhaps this is already supported by some combination
> > > of features which I don't know)
> > 
> > Have you tried scroll-lock-mode?
> 
> Yes, it's nice, but I also want the normal scroll-{up,down} commands to
> work.
> 
> 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.




  reply	other threads:[~2023-08-01 16:05 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31 20:18 Make scroll-{up, down} move point to {start, end} of newly visible text Spencer Baugh
2023-08-01  1:26 ` [External] : " Drew Adams
2023-08-01 11:44   ` hw
2023-08-01  5:11 ` Michael Heerdegen
2023-08-01 14:49   ` [External] : " Drew Adams
2023-08-01 11:28 ` hw
2023-08-01 14:45   ` Spencer Baugh
2023-08-01 16:05     ` hw [this message]
2023-08-01 12:42 ` Eli Zaretskii
2023-08-01 14:50   ` Spencer Baugh
2023-08-01 15:44     ` Eli Zaretskii
2023-08-01 18:09       ` Spencer Baugh
2023-08-01 18:35         ` Eli Zaretskii
2023-08-01 18:43           ` Spencer Baugh
2023-08-03 19:58             ` Spencer Baugh
2023-08-04  5:31               ` Eli Zaretskii
2023-08-06 20:02                 ` Emanuel Berg
2023-08-08 12:41                   ` Eli Zaretskii
2023-08-09 20:59                     ` Emanuel Berg
2023-08-10 17:33                       ` Eli Zaretskii
2023-08-10 18:06                         ` Emanuel Berg
2023-08-11 11:30                           ` Eli Zaretskii
2023-08-11 12:19                             ` Emanuel Berg
2023-08-11 18:40                               ` Eli Zaretskii
2023-08-11 19:00                                 ` Emanuel Berg
2023-08-12 13:30                                   ` Eli Zaretskii
2023-08-11 19:04                                 ` Emanuel Berg
2023-08-12 13:31                                   ` Eli Zaretskii
2023-08-12 15:35                                     ` Emanuel Berg
2023-08-13 13:23                                       ` Eli Zaretskii
2023-08-20  3:38                                         ` Emanuel Berg
2023-08-22 12:29                                           ` Eli Zaretskii
2023-08-22 19:41                                             ` Emanuel Berg
2023-08-24  4:43                                               ` Eli Zaretskii
2023-08-24  5:13                                                 ` Emanuel Berg
2023-08-16 16:20   ` Spencer Baugh
2023-08-16 16:53     ` Eli Zaretskii
2023-08-16 17:55       ` Spencer Baugh
2023-08-16 18:33         ` Eli Zaretskii
2023-08-16 20:32           ` Spencer Baugh
2023-08-17  5:18             ` Eli Zaretskii
2023-08-17 12:19               ` Spencer Baugh
2023-08-17 12:30                 ` Eli Zaretskii
2023-08-02 10:06 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d287c4a1b9011bf53fe95d3dc188763b6e358f5.camel@adminart.net \
    --to=hw@adminart.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).