I am using this minor mode to scroll and keep cursor on same line, mwheel-scroll
however screws up the smooth scroll since it moves the cursor to a different line, scrolling return the cursor back to original line but the visual is not smooth.
I tried:
scroll-preserve-screen-position 'always
But that didn't help.
This is the minor mode I am using:
(define-minor-mode centered-point-mode
"Always center the cursor in the 1/3rd of the screen."
:lighter "..."
(cond (centered-point-mode (add-hook 'post-command-hook 'line-change))
(t (remove-hook 'post-command-hook 'line-change))))
(setq recenter-positions '(0.35))
(defun line-change ()
(interactive)
(unless (memq this-command '(mwheel-scroll mac-mwheel-scroll))
(recenter-top-bottom)))
(define-globalized-minor-mode my-global-centered-point-mode centered-point-mode
(lambda () (centered-point-mode 1)))
(my-global-centered-point-mode 1)