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

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

Re: Emacs text cursor position


From: Cristian Gutierrez
Subject: Re: Emacs text cursor position
Date: Tue, 25 Jan 2005 16:04:49 -0300
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

Este domingo, ummajera@yahoo.ca dijo:
> I'm trying to customize Emacs to my needs/wants and so far so good.
> The only snag I encountered is in the position of the cursor. I want
> to be able to to scroll the  buffer with mouse wheel or on the scroll
> bars and have the cursor remain on the original line, even if the
> cursor moves off-screen. Then when I start typing, emacs does C-l to
> center back on the cursor, if the cursor is off-screen.
>
> Is it possible to customize Emacs in this way? How can I set "mouse
> scroll" not to affect the position of the cursor?

Not exactly what you're asking (dunno about the mouse wheel), but I use
this hack to scroll text without getting the cursor off the center of
the screen:

,----
| ;; "smooth" scroll
| (defun guti-scroll-up (cuenta)
|   (interactive "p")
|   (move-to-window-line nil)
|   (scroll-up cuenta)
|   (forward-line cuenta)
|   )
| 
| (defun guti-scroll-down (cuenta)
|   (interactive "p")
|   (move-to-window-line nil)
|   (scroll-down cuenta)
|   (forward-line (* -1 cuenta))
|   )
| 
| (global-set-key (kbd "C-<") 'guti-scroll-down)
| (global-set-key (kbd "C->") 'guti-scroll-up)
`----

HTH,

-- 
Cristian Gutierrez                      http://www.dcc.uchile.cl/~crgutier
crgutier[@]dcc.uchile.cl                        Jabber:crgutier@jabber.org

"If builders built buildings the way programmers write programs, then
the first woodpecker that came along would destroy civilization."
                              -- Weinberg's Second Law.




reply via email to

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