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: Sun, 31 May 2015 05:04:40 +0000 (UTC)
User-agent: tin/2.2.1-20140504 ("Tober an Righ") (UNIX) (NetBSD/6.1.5 (i386))

Jorge A. Alfaro-Murillo <jorge.alfaro-murillo@yale.edu> wrote:
> JohnF writes: 
> 
>> Thanks for terminology correction. Well, I do want to see the 
>> point, but, yes, very definitely, I want it to stay fixed when 
>> text scrolls.  That is, keboard page up/down should scroll text 
>> and not move point.  Ditto for mouse wheel scrolling and for 
>> mouse drag bar. 
> 
> It is like that by default,
   No, i.e., by "point fixed" I mean "fixed position on screen".
   Default -- at least for me -- is that it stays "fixed" on the
   same buffer character, which means that as the character scrolls
   up or down the point moves up or down with it.
> except when the point gets out of view.
   Right, when point gets near top or bottom, it jumps back towards
   center and then stays on a new buffer character until it jumps again.
      Of course, if point stays fixed on screen, as I'd prefer,
   it never needs to jump anyway, so jumping becomes a moot "point" :)

> I have never seen any mode that doesn't show the point in a 
> window, which is basically what you need if I understand 
> correctly,

I do want to see the point, and hadn't realized I'd said anything
that might be interpreted as not wanting to see the point at all.
It's point movement when text scrolls that I was asking about.

> if someone knows about a mode that behaves like that it 
> might be a good start to figure out how to do it. 
> 
>>  My .emacs works fine for keyboard page up/down, but not for 
>> mouse. For keyboard arrow up/down, point should (of course) move 
>> one row, but shouldn't jump back towards center when it nears 
>> window top/bottom.  And my .emacs already works for that, too. 
>> So no problem there. Just with mouse. 
>> 
>>> I know that is standard "modern" editor behavior, but why would 
>>> you want that? 
>> 
>> That's just my preference. Yours is apparently different, which 
>> is okay by me. I can no more "justify" my own editor preference 
>> than I can justify my favorite flavor ice cream (mocha almond 
>> crunch).  The very first line of the gnu emacs page 
>>    http://www.gnu.org/software/emacs/ 
>> says 
>>    "GNU Emacs is an extensible, customizable text editor..." 
>> which sounds to me like they're very intentionally acknowledging 
>> the importance of accommodating different preferences for 
>> different people, rather than establishing their own personal 
>> preferences (whatever those happen to be) as the standard. 
> 
> "It is your preference" is another way to say that you want it 
> that way, I was just asking why, to see if there was another way 
> to do what you want, for example, if it is to go to where you were 
> before,

No, I don't want to "go where I was before", if by that you mean the point
should go back to the same buffer character it was on before scrolling.
Maybe you misunderstood my wording in some way, and that misunderstanding
made you think my preference was unusual. If the point stays fixed
on screen, then it's on different buffer characters as text scrolls
"underneath" it.

> there are better ways: pushing the mark, adding the point 
> to the register, bookmarks, multiple windows and winner-mode, etc. 
> That is why I wanted to know, I am not trying to establish my 
> personal preferences, if I would be trying to establish my 
> preferences I would have asked why do you need to use the mouse in 
> the first place.
> 
> It just feels like the reason you want that is that you are used to that
> behavior with other editors. You can certainly tweak emacs to do what
> you want, but it will require quite a lot of effort and re-writing basic
> functions of movement and display of the window, plus quite a bit of
> knowledge of elisp.

Not really lots of effort... the .emacs I posted originally,
now along with Damien's additional suggestion, works exactly like I want.

> I just wanted to tell you that the fact that the
> point moves with scrolling when it gets out of sight was one of the
> things that striked me as a strange behavior when I started using emacs
> a couple of years ago, but once I understood better how the region and
> the mark work, that behavior made sense, especially when the region is
> active.

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


reply via email to

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