How can I return back to point position after jumping by <down-mouse-1>
?
Example: moving in the buffer for a while with C-pbfn
, then use mouse for navigation, and press C-u C-<space>
trying to return back, but last point not in mark-ring
.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this community(defun my-mouse-1 (event)
"..."
(interactive "e")
(mouse-set-point event)
(push-mark))
(global-set-key (kbd "<mouse-1>") 'my-mouse-1)
(Not that I really recommend doing this. You won't be able to take advantage of double and triple clicking mouse-1
.)
C-pbfn
I mean navigation via keyboard. And by<down-mouse-1>
– mouse clicking. So when I reposition cursor by mouse, I want to be able to jump back where it was byC-u C-<space>
, how I usually do while navigating via keyboard. Thank you.mouse-1
, I guess. That does not set the mark. Are you asking how to make it set the mark? If so, that's easy to do, but if you use the mouse at all besides just clickingmouse-1
then that will interfere with what it normally does. Normally,mouse-1
sets point, not the mark. That lets you drag the mouse to select text or usemouse-3
to select text or double- or triple-clickmouse-1
to select text. Better be sure of what you want first. ;-) Have you tried clickingmouse-1
followed by immediately clickingmouse-3
? Does have the effect you're looking for?