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: JohnF
Subject: Re: .emacs to keep cursor stationary when scrolling with mouse
Date: Sat, 30 May 2015 03:25:34 +0000 (UTC)
User-agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (NetBSD/6.1.5 (i386))

Damien Wyart <damien.wyart@free.fr> wrote:
>> > You could try to add:
>> >   (setq mouse-wheel-progressive-speed nil)
>> > to your .emacs.
> 
> * JohnF <john@please.see.sig.for.email.com> in gnu.emacs.help:
>> Thanks, Damien. Added it after ...follow-mouse, i.e.,
>> from .emacs in original post
>> ...
>> (setq mouse-wheel-follow-mouse 't) ;;; scroll window under mouse
>> (setq mouse-wheel-progressive-speed nil) ;;; <-- added your suggestion
>> ...
>> But it had no effect. Does it do anything for you???
> 
> In fact, I did not try it myself, but borrowed it from here:
> 
> http://www.emacswiki.org/emacs/SmoothScrolling
> http://stackoverflow.com/questions/445873/how-can-i-make-emacs-mouse-scrolling-slower-and-smoother

Thanks again, Damien...

> Your .emacs looked correct,

Full disclosure: not really "mine", but cobbled together from
numerous suggestions I got from this ng and other emacs forums.

> and I have read here or there that
> mouse-wheel-progressive-speed did help in some cases, but maybe there
> has been a misunderstanding on what you would like exactly.
> 
> Here is some further reading on this topic and closely related ones;
> could you tell us if some of these solutions work for you, and if not,
> what you would like precisely?

Thanks for additional references below. The one labelled
   emacs-scroll-buffer-not-point
sounds like what I want, but it seems to address keyboard scrolling,
which is already handled. Instead, the one labelled
   emacs-mouse-wheel-scroll-preserve-buffer-position
seems to actually address my problem (though "preserve-buffer-position"
when scrolling sounds to me like an oxymoron). And very unfortunately,
the posted answer after the op describes his (and what sounds
like my) request is...
   "You can't." ...
which pretty succinctly (if correct) sums it up.

If I'm not precisely describing my request, then you can use my
.emacs and watch the point as you keyboard-scroll through your buffer.
The point (I apparently incorrectly said "cursor" -- I mean the
on-screen, often blinking, symbol that indicates where text
will be inserted when you start typing) should remain stationary
in the window when you page-up/down and when you scroll text.
When you arrow-up/down, the point should move one line up/down
at a time, without scrolling text. When the point nears the top/bottom
of the window, it >>shouldn't<< jump back towards center.
Instead, it should just stay at the top/bottom row,
and start scrolling text one line at a time.
   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.
   The one okay exception is when the point starts on some row,column,
and then a text line that scrolls underneath it is shorter than the
original column number. Then point stays on its row, but column jumps
to end-of-(that-)line. But later, when a sufficiently long text line
scrolls underneath point, it jumps back to original column.
   Very lengthy description above -- simpler to just try it out,
whereby described behaviour is obvious.

> http://elpa.gnu.org/packages/scroll-restore.html
> http://stackoverflow.com/questions/10348473/emacs-mouse-wheel-scroll-preserve-buffer-position
> http://stackoverflow.com/questions/9616623/ctrl-up-down-style-scrolling-in-emacs/9620883#9620883
> http://stackoverflow.com/questions/8993183/emacs-scroll-buffer-not-point
> http://superuser.com/questions/527356/dont-change-the-cursor-position-when-scrolling-in-emacs
> http://stackoverflow.com/questions/15895313/let-emacs-move-the-cursor-off-screen
> http://emacs.stackexchange.com/questions/61/let-emacs-move-the-cursor-off-screen

-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )


reply via email to

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