help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make scroll-{up, down} move point to {start, end} of newly visible t


From: Eli Zaretskii
Subject: Re: Make scroll-{up, down} move point to {start, end} of newly visible text
Date: Tue, 01 Aug 2023 21:35:28 +0300

> From: Spencer Baugh <sbaugh@janestreet.com>
> Date: Tue, 01 Aug 2023 14:09:47 -0400
> 
> An issue with a solution based on scroll-margin is that scroll-margin
> applies even when at the end of the buffer.  I'd like to be able to have
> the end of the buffer at the end of the window, to maximize the amount
> of content on-screen at a time.
> 
> In particular comint buffers, like async-shell-command and compilation
> and shell-mode, become quite ugly with scroll-margin on, since in such
> buffers one is generally always at the end of the buffer.
> 
> Is there a way to teach scroll-margin to not do automatic scrolling when
> point is near the end of the buffer?

You _can_ have EOB at the end of the window, you just cannot move
point into the margin without causing a scroll.

> > 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?
> 
> With the arrows I would have to move point to the top or end of the
> screen before scrolling, which is annoying.

Nothing 2 or 3 C-l's cannot fix, right?

> Also, arrows move point, and it might be nice to be able to scroll
> without moving point.

Scrolling by a small number of lines will eventually move point as
well.

> scroll-up-line and scroll-down-line would work well for me, but they
> don't have key bindings by default.  If they did, I'd use them.

I have these since about forever:

  (global-set-key "\M-z" (function (lambda () (interactive) (scroll-down 1))))
  (global-set-key "\C-z" (function (lambda () (interactive) (scroll-up 1))))

But I don't see a need to force my preferences on everyone else,
especially since C-z has a useful binding which many prefer to keep.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]