all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Smooth image scrolling
@ 2020-10-08  4:25 Michael Heerdegen
  2020-10-08  4:35 ` Stefan Monnier
  2020-10-08  8:00 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Heerdegen @ 2020-10-08  4:25 UTC (permalink / raw)
  To: Emacs mailing list

Hello,

sorry to bring up again this old topic, but I couldn't find a solution
that I liked.

I have experimented with Calc and making the output buffer show the
results as an image (gotten from tex'ing the latex form of the result).

Normally, the calc buffers are only a few lines tall, and one image may
be quite as large, or even larger.  Everything is narrow.

Normal mouse-whell scrolling just jumps past the image, so you have no
chance to see the second half of it.  Even if I scroll in one-line
steps.

So I experimented with scrolling by changing the window's vscroll (as
image-mode uses to do).  Oh, pixel-scroll-mode doesn't behave much
nicer, so that didn't help.

But now changing the windows vscroll comes with new problems.  When
increasing the window's vscroll (say, by one) moves the cursor out of
view, Emacs (redisplay I guess) moves it back into the visible buffer
part (it doesn't change point), and what I get is actually scrolling
backwards.

I then tried to adjust point manually, which is not that simple.  But
even then - when I want to get back to standard scrolling (say I have
now scrolled past the first image), Emacs silently undoes the vscroll
setting, again scrolling backwards in effect.  So I would have to handle
that effect as well, probably reimplementing more or less the whole
scrolling algorithms.

Do I miss something, or is this really ... a bit hard to achieve?

TIA,

Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Smooth image scrolling
  2020-10-08  4:25 Smooth image scrolling Michael Heerdegen
@ 2020-10-08  4:35 ` Stefan Monnier
  2020-10-08  8:00 ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2020-10-08  4:35 UTC (permalink / raw)
  To: help-gnu-emacs

> Do I miss something, or is this really ... a bit hard to achieve?

I believe it's a bit hard to achieve.  I know Eli (and others) has made
various improvements to that part of the code over the years, but we
started from pretty far, and AFAIK there's still a fair bit of room
for improvement.


        Stefan




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Smooth image scrolling
  2020-10-08  4:25 Smooth image scrolling Michael Heerdegen
  2020-10-08  4:35 ` Stefan Monnier
@ 2020-10-08  8:00 ` Eli Zaretskii
  2020-10-09  3:18   ` Michael Heerdegen
  1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2020-10-08  8:00 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Thu, 08 Oct 2020 06:25:10 +0200
> 
> Normally, the calc buffers are only a few lines tall, and one image may
> be quite as large, or even larger.  Everything is narrow.
> 
> Normal mouse-whell scrolling just jumps past the image, so you have no
> chance to see the second half of it.  Even if I scroll in one-line
> steps.
> 
> So I experimented with scrolling by changing the window's vscroll (as
> image-mode uses to do).  Oh, pixel-scroll-mode doesn't behave much
> nicer, so that didn't help.
> 
> But now changing the windows vscroll comes with new problems.  When
> increasing the window's vscroll (say, by one) moves the cursor out of
> view, Emacs (redisplay I guess) moves it back into the visible buffer
> part (it doesn't change point), and what I get is actually scrolling
> backwards.
> 
> I then tried to adjust point manually, which is not that simple.  But
> even then - when I want to get back to standard scrolling (say I have
> now scrolled past the first image), Emacs silently undoes the vscroll
> setting, again scrolling backwards in effect.  So I would have to handle
> that effect as well, probably reimplementing more or less the whole
> scrolling algorithms.
> 
> Do I miss something, or is this really ... a bit hard to achieve?

It's not easy.

First thing I don't understand is whether you are trying this with the
mouse or with C-n/C-p.  The latter should already work reasonably well
for tall images (i.e. images taller than the window), see line-move
and its subroutines line-move-visual and line-move-partial.  Maybe the
code there will give you ideas for how to solve your problem?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Smooth image scrolling
  2020-10-08  8:00 ` Eli Zaretskii
@ 2020-10-09  3:18   ` Michael Heerdegen
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Heerdegen @ 2020-10-09  3:18 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> First thing I don't understand is whether you are trying this with the
> mouse or with C-n/C-p. 

With the mouse.

> The latter should already work reasonably well for tall images
> (i.e. images taller than the window), see line-move and its
> subroutines line-move-visual and line-move-partial.  Maybe the code
> there will give you ideas for how to solve your problem?

Will have a look.  The first thing I noticed was that I had set
line-move-visual > nil in my config.  When I set it (back) to t (the
default) the behavior is already much better.

I don't recall why I had set line-move-visual > nil some time ago.  I
guess something didn't work the way I wanted or expected and that
problem is maybe long solved.  I've set it now t in my config and will
see what I experience, and how image scrolling feels like with that.

Regards,

Michael.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-09  3:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-08  4:25 Smooth image scrolling Michael Heerdegen
2020-10-08  4:35 ` Stefan Monnier
2020-10-08  8:00 ` Eli Zaretskii
2020-10-09  3:18   ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.