Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Smooth scrolling

722 views
Skip to first unread message

Marcelo de Moraes Serpa

unread,
Jul 6, 2010, 12:32:29 PM7/6/10
to help-gn...@gnu.org
Hi,

I know many of might say it's "not needed", but I find that, to get an
overview of the file and when you are still getting acquanted to it,
scrolling slowly (without jumps) is useful. Textmate does it the way I
like. Emacs' scrolling is too "jumpy".

Is there a way to setup emacs for a almost-flawless smooth scrolling mode?

Thanks,

Marcelo.

Juanma Barranquero

unread,
Jul 6, 2010, 12:37:42 PM7/6/10
to Marcelo de Moraes Serpa, help-gn...@gnu.org
> Is there a way to setup emacs for a almost-flawless smooth scrolling mode?

You can try

(setq redisplay-dont-pause t
scroll-conservatively most-positive-fixnum
scroll-step 0)

and perhaps, depending on your tastes

(setq scroll-preserve-screen-position 'always)

Juanma

Marcelo de Moraes Serpa

unread,
Jul 6, 2010, 12:42:11 PM7/6/10
to Juanma Barranquero, help-gn...@gnu.org
Thanks for the reply, Juanma,

> (setq redisplay-dont-pause t
> scroll-conservatively most-positive-fixnum
> scroll-step 0)
>
> and perhaps, depending on your tastes
>
> (setq scroll-preserve-screen-position 'always)
>

I evaluated them on scratch but didn't see any difference. How am I
supposed to use the code?

Cheers,

Marcelo.

Marcelo de Moraes Serpa

unread,
Jul 6, 2010, 12:42:52 PM7/6/10
to Juanma Barranquero, help-gn...@gnu.org
PS: I'd like it to work with the mouse wheel too.

Thanks,

Marcelo.

Deniz Dogan

unread,
Jul 6, 2010, 12:45:25 PM7/6/10
to Marcelo de Moraes Serpa, help-gn...@gnu.org
2010/7/6 Marcelo de Moraes Serpa <celo...@gmail.com>:

> Thanks for the reply, Juanma,
>
>> (setq redisplay-dont-pause t
>>      scroll-conservatively most-positive-fixnum
>>      scroll-step 0)
>>
>> and perhaps, depending on your tastes
>>
>> (setq scroll-preserve-screen-position 'always)
>>
>
> I evaluated them on scratch but didn't see any difference. How am I
> supposed to use the code?
>

The code that Juanma gave you makes Emacs scroll "line by line" when
moving the cursor. Are you by any chance using the scroll wheel to
scroll?

--
Deniz Dogan

Marcelo de Moraes Serpa

unread,
Jul 6, 2010, 12:47:54 PM7/6/10
to Deniz Dogan, help-gn...@gnu.org
Yeah, I do use the wheel to scroll from time to time, it's pretty
useful to scan a long file, for example.

Marcelo.

Juanma Barranquero

unread,
Jul 6, 2010, 1:16:17 PM7/6/10
to Marcelo de Moraes Serpa, help-gn...@gnu.org
On Tue, Jul 6, 2010 at 18:42, Marcelo de Moraes Serpa
<celo...@gmail.com> wrote:

> I evaluated them on scratch but didn't see any difference. How am I
> supposed to use the code?

Evaluating it, or adding it to .emacs, should suffice.

You didn't give much information. Emacs version, platform? What do you
mean exactly by smooth scrolling? I assumed you wanted line-by-line
scrolling with the cursor.

Juanma

Marcelo de Moraes Serpa

unread,
Jul 6, 2010, 5:15:15 PM7/6/10
to Juanma Barranquero, help-gn...@gnu.org
Emacs on OSX Snow Leopard, v. 23.2. I'd like wheel-scrolling that
works like Textmate's scrolling. It's not really line by line, I think
it is pixel-based. Either way, with Textmate, you can scroll a huge
file with the mouse without it jumping large portions, and it also
doesn't have rendering glitches. Emacs does. The keyboard scrolling
for me is fine -- I mainly use C-r/s when using the keyboard, anyway.

Thanks!

Marcelo.

Deniz Dogan

unread,
Jul 6, 2010, 5:21:21 PM7/6/10
to Marcelo de Moraes Serpa, help-gn...@gnu.org
2010/7/6 Marcelo de Moraes Serpa <celo...@gmail.com>:

> Emacs on OSX Snow Leopard, v. 23.2. I'd like wheel-scrolling that
> works like Textmate's scrolling. It's not really line by line, I think
> it is pixel-based. Either way, with Textmate, you can scroll a huge
> file with the mouse without it jumping large portions, and it also
> doesn't have rendering glitches. Emacs does. The keyboard scrolling
> for me is fine -- I mainly use C-r/s when using the keyboard, anyway.
>

I understand exactly what you mean by pixel-based scrolling. This is
how many other editors work, e.g. Notepad or Textmate. I'd love to
have that as well, but I don't think there is anything like that in
Emacs today. Many parts of Emacs are about columns and lines, e.g. the
size of frames are "measured" in columns and lines.

--
Deniz Dogan

Jesse W. Wilson

unread,
Jul 6, 2010, 9:47:00 PM7/6/10
to help-gn...@gnu.org
Pixel-based scrolling would be nice for my applications too. I use
org-mode and iimage-mode to keep a laboratory notebook, and scrolling
with this combination is awful. If I want to scan through my notes I
have to export to html and open in a web browser to get the right feel.

Also, on my tablet PC (Windows 7), every application I have works great
with single-finger panning (similar to the way iPod/iPad scrolls) except
for emacs.

--
------------------------------------------------------------------
Jesse Wilson
Bartels Lab: Ultrafast and Nonlinear Optics
Electrical and Computer Engineering Department
Colorado State University
jes...@engr.colostate.edu

Marcelo de Moraes Serpa

unread,
Jul 7, 2010, 2:12:28 PM7/7/10
to Jesse W. Wilson, help-gn...@gnu.org
Let's join efforts and ask for it then :)

Is there a place we could submit/vote for feature suggestions for next
emacs versions?

Cheers,

Marcelo.

Marcelo de Moraes Serpa

unread,
Jul 7, 2010, 3:40:26 PM7/7/10
to Deniz Dogan, help-gn...@gnu.org
Thanks Deniz,

I already did my part. Hopefully they will take it into account and
think about it.

As a side-note, I think emacs has *lots* of potential to be
"mainstream" -- but not in the bad sense. I don't really care if it is
as popular as Textmate or not, and I know it takes guts, time and
effort to actually be productive on emacs, but we all know that, once
we have the skills, it becames the one true editor.

However, I do feel we need to "modernize" many aspects of emacs. I'm
not talking only about the application itself, and I'm not also
talking about huge changes, but we do need to bring emacs to the new
century with some sublte changes like this one, while keeping its
essency, of course.

My 2c,

/Marcelo.
On Wed, Jul 7, 2010 at 2:21 PM, Deniz Dogan <deniz.a...@gmail.com> wrote:
> 2010/7/7 Marcelo de Moraes Serpa <celo...@gmail.com>:


>> Let's join efforts and ask for it then :)
>>
>> Is there a place we could submit/vote for feature suggestions for next
>> emacs versions?
>>
>

> The correct way to do this is probably M-x report-emacs-bug and add
> the tag/severity (I can never remember which) "wishlist". I wouldn't
> count on it happening any time soon though! :(
>
> --
> Deniz Dogan
>

Deniz Dogan

unread,
Jul 7, 2010, 3:21:51 PM7/7/10
to Marcelo de Moraes Serpa, help-gn...@gnu.org

Jesse W. Wilson

unread,
Jul 7, 2010, 3:29:59 PM7/7/10
to help-gn...@gnu.org
Perhaps the following could be of use?
http://www.gnu.org/s/emacs/manual/html_node/elisp/Vertical-Scrolling.html

If I type this in a buffer and eval with c-x c-e,
(set-window-vscroll (selected-window) 0.3)

It seems to scroll a fraction of a line downward.

Of course I haven't a clue how it could be incorporated into bindings
for the scroll wheel.

--
------------------------------------------------------------------
Jesse Wilson
Bartels Lab: Ultrafast and Nonlinear Optics
Electrical and Computer Engineering Department
Colorado State University
jes...@engr.colostate.edu

David Engster

unread,
Jul 8, 2010, 4:51:04 AM7/8/10
to help-gn...@gnu.org
Jesse W. Wilson writes:
> Perhaps the following could be of use?
> http://www.gnu.org/s/emacs/manual/html_node/elisp/Vertical-Scrolling.html
>
> If I type this in a buffer and eval with c-x c-e,
> (set-window-vscroll (selected-window) 0.3)
>
> It seems to scroll a fraction of a line downward.
>
> Of course I haven't a clue how it could be incorporated into bindings
> for the scroll wheel.

Yes, Emacs can do "fractional" (read: pixel-wise) scrolling with the
set-window-vscroll command you mentioned above. For example,
picture-mode can smooth-scroll an image just fine. However, there are
two caveats: it is slow, and the point must remain visible during
scrolling.

I've fiddled with this stuff a while ago to implement a smoother
scrolling for buffers with images in them. See

http://www.randomsample.de/dru5/node/25
http://www.randomsample.de/dru5/node/26

for how far I've come. Those functions use set-window-vscroll to scroll
the buffer and move point in a way so that it always remains
visible. However, you'll notice that the higher the vscroll value of the
current window, the slower scrolling becomes, so it's of limited
value. Also, it doesn't work well with the other point-moving commands,
so it's currently only useful for read-only buffers.

Regards,
David


Andreas Politz

unread,
Jul 8, 2010, 6:01:05 AM7/8/10
to
David Engster <de...@randomsample.de> writes:

> Jesse W. Wilson writes:

> Yes, Emacs can do "fractional" (read: pixel-wise) scrolling with the
> set-window-vscroll command you mentioned above. For example,
> picture-mode can smooth-scroll an image just fine. However, there are
> two caveats: it is slow, and the point must remain visible during
> scrolling.
>

Allowing point to go off-window is like allowing the mouse-pointer to go
off-screen, a nightmare.

-ap

Marcelo de Moraes Serpa

unread,
Jul 8, 2010, 11:05:03 AM7/8/10
to help-gn...@gnu.org
http://zwell.net/content/emacs.html

This is the nearest to what I'd like, seems to work, although has some
small glitches.

Marcelo.

On Thu, Jul 8, 2010 at 3:51 AM, David Engster <de...@randomsample.de> wrote:
> Jesse W. Wilson writes:
>> Perhaps the following could be of use?
>> http://www.gnu.org/s/emacs/manual/html_node/elisp/Vertical-Scrolling.html
>>
>> If I type this in a buffer and eval with c-x c-e,
>> (set-window-vscroll (selected-window) 0.3)
>>
>> It seems to scroll a fraction of a line downward.
>>
>> Of course I haven't a clue how it could be incorporated into bindings
>> for the scroll wheel.
>

> Yes, Emacs can do "fractional" (read: pixel-wise) scrolling with the
> set-window-vscroll command you mentioned above. For example,
> picture-mode can smooth-scroll an image just fine. However, there are
> two caveats: it is slow, and the point must remain visible during
> scrolling.
>

0 new messages