unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to keep cursor stationary when scrolling with mouse
@ 2014-11-18  1:41 JohnF
  2014-11-18  2:24 ` Emanuel Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: JohnF @ 2014-11-18  1:41 UTC (permalink / raw)
  To: help-gnu-emacs

My .emacs init has
  (setq scroll-preserve-screen-position t)
  (setq scroll-conservatively 0)
  (setq auto-window-vscroll nil)
  (setq scroll-up nil)
  (setq scroll-down nil)
  (setq scroll-up-aggressively nil)
  (setq scroll-down-aggressively nil)
some of which may be unnecessary, redundant, or wrong
(I don't know elisp or exactly what I'm doing here).
But it keeps the point/cursor stationary on the screen
when scrolling with keyboard keys Page and Arrow Up/Down.
That's what I want.
    But when scrolling with the mouse, either with its
wheel or by dragging the right-hand side slider bar, the
cursor reverts to default behavior, following the text and
jumping back to center when scrolling past the page top/bottom.
    I've failed to google how to stop that. What can I put
in .emacs so that the point/cursor remains stationary on
the screen, rather than following the text, when scrolling
with the mouse? Thanks,
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to keep cursor stationary when scrolling with mouse
  2014-11-18  1:41 how to keep cursor stationary when scrolling with mouse JohnF
@ 2014-11-18  2:24 ` Emanuel Berg
  2014-11-19  3:17   ` JohnF
  2014-11-18 11:30 ` Michael Heerdegen
       [not found] ` <mailman.13943.1416310235.1147.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2014-11-18  2:24 UTC (permalink / raw)
  To: help-gnu-emacs

JohnF <john@please.see.sig.for.email.com> writes:

> But it keeps the point/cursor stationary on the
> screen when scrolling with keyboard keys Page and
> Arrow Up/Down. That's what I want.

Are you sure you don't want a keystroke that doesn't
involve moving your hands from typing position? :)
Like M-i and M-k for scrolling a single line without
moving point? Just saying...

> But when scrolling with the mouse, either with its
> wheel or by dragging the right-hand side slider bar,
> the cursor reverts to default behavior, following
> the text and jumping back to center when scrolling
> past the page top/bottom. I've failed to google how
> to stop that. What can I put in .emacs so that the
> point/cursor remains stationary on the screen,
> rather than following the text, when scrolling with
> the mouse? Thanks,

I don't know because I don't use the mouse, but I
scroll without moving point (unless scrolling scrolls
a whole screen of lines), probably you can use exactly
the same, binding the mouse to it. But try it
keyboard-only first, see if you like it.

Here is the scroll stuff, I have M-i and M-k to
scroll-up-1 and scroll-down-1:

http://user.it.uu.se/~embe8573/conf/emacs-init/scroll.el

-- 
underground experts united


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to keep cursor stationary when scrolling with mouse
  2014-11-18  1:41 how to keep cursor stationary when scrolling with mouse JohnF
  2014-11-18  2:24 ` Emanuel Berg
@ 2014-11-18 11:30 ` Michael Heerdegen
       [not found] ` <mailman.13943.1416310235.1147.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 6+ messages in thread
From: Michael Heerdegen @ 2014-11-18 11:30 UTC (permalink / raw)
  To: help-gnu-emacs

JohnF <john@please.see.sig.for.email.com> writes:

>     I've failed to google how to stop that. What can I put
> in .emacs so that the point/cursor remains stationary on
> the screen, rather than following the text, when scrolling
> with the mouse? Thanks,

AFAIK `centered-cursor-mode' makes Emacs behave like that:

   http://www.emacswiki.org/emacs/centered-cursor-mode.el


Michael.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to keep cursor stationary when scrolling with mouse
       [not found] ` <mailman.13943.1416310235.1147.help-gnu-emacs@gnu.org>
@ 2014-11-19  2:59   ` JohnF
  0 siblings, 0 replies; 6+ messages in thread
From: JohnF @ 2014-11-19  2:59 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> wrote:
> JohnF <john@please.see.sig.for.email.com> writes:
>>     I've failed to google how to stop that. What can I put
>> in .emacs so that the point/cursor remains stationary on
>> the screen, rather than following the text, when scrolling
>> with the mouse? Thanks,
> 
> AFAIK `centered-cursor-mode' makes Emacs behave like that:
>   http://www.emacswiki.org/emacs/centered-cursor-mode.el
> Michael.

Thanks, but that's an awful lot of elisp. I'll probably just let
emacs have its own way rather than try to import all that stuff.
I was hoping for something more like
  (setq mouse-wheel-follow-mouse 't)
But I can't google anything like it that does what I want.
Right now, I've got it working okay for keyboard input, i.e.,
     up/down arrow: Cursor moves up/down one line per keypress
         and text remains stationary. When cursor reaches top/bottom
         of the window, text scrolls one line up/down per corresponding
         keypress while cursor remains stationary at top/bottom.
     page up/down: text scrolls one page up/down while cusor remains
         stationary at all times.
What I want for mouse wheel scroll or for mouse dragging slider bar
is the same as for page up/down, i.e., text scrolls while cursor
remains stationary at all times. But what I'm getting is
     for both wheel and slider bar: Cursor moves along with text.
         When cursor tries to scroll above top of window, it jumps
         to 12th line down from top. Ditto when cursor tries to
         scroll below bottom of window, it jumps all the way back
         to 12th line from top.
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to keep cursor stationary when scrolling with mouse
  2014-11-18  2:24 ` Emanuel Berg
@ 2014-11-19  3:17   ` JohnF
  2014-11-27  3:35     ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: JohnF @ 2014-11-19  3:17 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg <embe8573@student.uu.se> wrote:
> JohnF <john@please.see.sig.for.email.com> writes:
> 
>> But it keeps the point/cursor stationary on the
>> screen when scrolling with keyboard keys Page and
>> Arrow Up/Down. That's what I want.
> 
> Are you sure you don't want a keystroke that doesn't
> involve moving your hands from typing position? :)
> Like M-i and M-k for scrolling a single line without
> moving point? Just saying...

Thanks, but I'm happy, comfortable, and accustomed
to keyboard behavior exactly as it's currently configured.

>> But when scrolling with the mouse, either with its
>> wheel or by dragging the right-hand side slider bar,
>> the cursor reverts to default behavior, following
>> the text and jumping back to center when scrolling
>> past the page top/bottom. I've failed to google how
>> to stop that. What can I put in .emacs so that the
>> point/cursor remains stationary on the screen,
>> rather than following the text, when scrolling with
>> the mouse? Thanks,
> 
> I don't know because I don't use the mouse, but I
> scroll without moving point (unless scrolling scrolls
> a whole screen of lines), probably you can use exactly
> the same, binding the mouse to it. But try it
> keyboard-only first, see if you like it.
> 
> Here is the scroll stuff, I have M-i and M-k to
> scroll-up-1 and scroll-down-1:
>   http://user.it.uu.se/~embe8573/conf/emacs-init/scroll.el

Thanks for the interesting stuff to look at.
-- 
John Forkosh  ( mailto:  j@f.com  where j=john and f=forkosh )


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: how to keep cursor stationary when scrolling with mouse
  2014-11-19  3:17   ` JohnF
@ 2014-11-27  3:35     ` Emanuel Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2014-11-27  3:35 UTC (permalink / raw)
  To: help-gnu-emacs

JohnF <john@please.see.sig.for.email.com> writes:

> Thanks, but I'm happy, comfortable, and accustomed
> to keyboard behavior exactly as it's currently
> configured.

Yeah. But you mentioned that it worked the way you
wanted for the keyboard. Can you bind the mouse input
to that same function? Shouldn't that give you the
same result?

-- 
underground experts united


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-27  3:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-18  1:41 how to keep cursor stationary when scrolling with mouse JohnF
2014-11-18  2:24 ` Emanuel Berg
2014-11-19  3:17   ` JohnF
2014-11-27  3:35     ` Emanuel Berg
2014-11-18 11:30 ` Michael Heerdegen
     [not found] ` <mailman.13943.1416310235.1147.help-gnu-emacs@gnu.org>
2014-11-19  2:59   ` JohnF

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).