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

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

Re: Persisting centered cursor with Scroll Lock key


From: Eric Eide
Subject: Re: Persisting centered cursor with Scroll Lock key
Date: Sat, 08 May 2004 17:59:33 -0600 (MDT)
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.1 (Cuyahoga Valley, berkeley-unix)

"Torsten" == Torsten Bronger <address@hidden> writes:

        Torsten> I've installed scroll-in-place.el and added (require
        Torsten> 'scroll-in-place) to my .emacs.  This .emacs doesn't contain
        Torsten> any other scroll setting commands except for (setq scroll-step
        Torsten> 1) (as far as I can see), *and* the (require 'scroll-in-place)
        Torsten> is almost the last command in the file.  But there is no
        Torsten> effect nevertheless.  [...]
        Torsten> 
        Torsten> Any ideas?

My first thought is that `scroll-in-place' is working, but that it's not doing
what you expect it to do.

In your original post, you asked for a way to keep the cursor (a.k.a. point) in
the middle of the window, no matter how point is caused to move within the
buffer.  That's not quite what `scroll-in-place' does.

The `scroll-in-place' package tries to keep point at its current visual
position --- whatever that happens to be --- across scrolling commands, and
*only* across scrolling commands (i.e., keys like PageUp, PageDown, C-v, and
M-v).  This is different than staying in the *middle* for *any* command.  For
instance, with `scroll-in-place' loaded, commands like `next-line' and
`previous-line' (keys like C-n, down-arrow, C-p, and up-arrow) still cause the
visual position of point to move.

(As an aside, I'll point out that even for scrolling commands, the "in-place"
behavior is subject to certain boundary conditions, e.g., at the ends of a
buffer, on short lines, etc.)

Here's a test to see if the package is working at all.  Load a large file
(several windows-full) and go to the beginning, so that the cursor is on the
first line of the window.  Now hit PageDown (or C-v) a few times, then hit
PageUp (or M-v) the same number of times.  If the package is loaded and
working, then the cursor should be back at the beginning of the window.  If the
package isn't loaded or isn't working, then point should be somewhere near the
bottom of the window.

My second thought is that there might be some other error in your `.emacs'
file, so the command that loads `scroll-in-place' isn't being executed.  (You
said that the `scroll-in-place' stuff is near the end of your `.emacs'.  If
Emacs finds an error in your `.emacs' file, then it stop processing at that
point --- and so the stuff at the end might not be run.)

You can check to see if the package is loaded in a number of ways.  Perhaps the
most straightforward way is to ask for the documentation of function
`scroll-window': type `M-x describe-function RET scroll-window RET'.  If the
documentation mentions `scroll-in-place', then the package is loaded.  If it
doesn't, or if the function isn't defined at all, then the package is not
loaded.

Finally, it's certainly possible that the package isn't working in your Emacs
for some reason, but I would need more details to figure out why.  What version
of Emacs are you using?  Does it work if you run Emacs without your `.emacs'
file (run `emacs -q' and then load the package manually (e.g., via `M-x
load-library')?

Thanks, and good luck! ---

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <address@hidden>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX


reply via email to

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