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

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

Re: .emacs to keep cursor stationary when scrolling with mouse


From: Damien Wyart
Subject: Re: .emacs to keep cursor stationary when scrolling with mouse
Date: Sat, 30 May 2015 11:45:34 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50

> [...] This is what it does with keyboard. Mouse wheel and drag bar
> always scroll text, but point gets dragged along with the scrolling
> text, and jumps back towards center when it nears window top/bottom.
> Instead, I'd like point to just remain stationary on screen, as yexy
> scrolls "underneath" it.

I could get what you want for the wheel by using this:

(global-set-key (kbd "<mouse-4>") 'scroll-down-command)
(global-set-key (kbd "<mouse-5>") 'scroll-up-command)

Can you confirm this is OK?

About the scrollbar, I do not use it myself (many users of emacs use
"(scroll-bar-mode -1)" in their .emacs and only use keyboard and mouse
wheel), but looking at the code this is more difficult to get the exact
behavior you want. When testing, this seems most of the time to do what
you want, but a few jumps apear from time to time, depending on the
content of the buffer.

-- 
DW


reply via email to

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