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

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

Re: window-vscroll broken?


From: Greg Hill
Subject: Re: window-vscroll broken?
Date: Fri, 14 Nov 2003 10:15:23 -0800

At 1:44 AM +0100 11/14/03, David Kastrup wrote:
Greg Hill <ghill@synergymicro.com> writes:

 I am trying to use the function window-vscroll in Emacs 21.2.2, and
 all it ever returns is 0.  Does anyone know if it is just broken, or
 am I doing something wrong?

Why should it return anything else unless you have set it to a value
different from 0?  It will only ever return something different from
0 if you have set it yourself (with set-window-vscroll) or if Emacs
has moved to the end of a buffer with a line at the top of the window
that is so tall that it can't be displayed completely.


Have you tried using it? Or are you just taking it for granted that I am a total moron?

I page down into a long buffer, so that the top line in the buffer is maybe line 100, I execute window-vscroll, and I get 0. I execute (set-window-vscroll nil 10) with the cursor on, say, the sixth line in the window (line 106 in the buffer) and either nothing at all happens or something weird happens like the current line moves to the third line of the window. Then (window-vscroll) will return 10 for a while, no matter how far up or down I scroll the page, until suddenly it starts returning 0 again regardless of what buffer line is currently in the first window line. The value returned by (window-vscroll) never seems to have anything at all to do with what line of the buffer currently appears in the top line of the window.

If that is not what happens on your platform, then perhaps there is something wrong with my installation, which is:

    GNU Emacs 21.2.2 (sparc-sun-solaris2.7, X toolkit)

Incidentally, I have found that (window-hscroll) and (set-window-hscroll) behave exactly as I would expect them to, i.e., when I (set-window-hscroll nil 10), the tenth column of my buffer moves to the first column of my window. Then if I use (scroll-left 1) or (scroll right 1), (window-hscroll) returns the number of the buffer column that currently appears in the first column of the window. I would expect (window-vscroll) and (set-window-vscroll) to behave in an analagous fashion, except vertically, e.g. the value returned by (window-vscroll) would change by 1 after I execute (scroll-up 1) or (scroll-down 1) -- assuming of course that I was not already at the top or bottom of the buffer so no scrolling occurred -- but instead it changes back to 0, no matter what buffer line is at the top of the window.

Has anyone else actually tried using these functions? If so, has your experience been different from mine?

Thanks.

--Greg




reply via email to

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