Subject: Re: bug#18739: 24.3; Request for a hook to be provided when scrolling will move the cursor

From: Eli Zaretskii <[email-masked]>
Date: Thu, 16 Oct 2014 17:46:32 +0300

> Date: Thu, 16 Oct 2014 08:35:03 -0600
> From: Josh <[email-masked]>
> Cc: [email-masked]
> 
> > I meant set the mark as part of the command that is run by the wheel
> > scroll, or manually just before you scroll.
> 
> If I configure the scroll wheel to set the mark every time I use it,
> then imagine how many times I might have to pop the mark to get back
> where I started if I scrolled down multiple screens.

If repeated use of mouse-wheel scroll is the issue, you can avoid
multiple settings or the mark by looking at last-command and
this-command.  There are already Emacs commands that behave
differently depending on whether they are repeated or not; one
prominent example is C-n and C-p.  So there are examples you could
study to see how this technique is applied.