scroll - Let Emacs move the cursor off-screen -
is possible let emacs have cursor moved off-screen, gui text editors work? 1 of biggest things bothers me when use emacs on gui editor. when scroll down, cursor "pushed forward" top of buffer.
i had thought impossible, because hard-wired architecture of emacs, saw multiple-cursors, secondary cursors (assuming prevent scrolling functions acting on secondary cursors). maybe possible use multiple-cursors have main cursor in hidden buffer, , effective cursor being edit with? or maybe other clever trick? or maybe googling has failed me , possible without magic?
there new package available on gnu elpa called scroll-restore
attempts remedy problem. far, have encountered few bugs, package seems work as-advertised part.
you can test out installing with
m-x package-install ret scroll-restore ret
after package installed, can enable minor mode with
m-x scroll-restore-mode
personally, binding scroll lock key because seems incredibly apropos! adding init file:
(require 'scroll-restore) (scroll-restore-mode 1) ;; allow scroll-restore modify cursor face (setq scroll-restore-handle-cursor t) ;; make cursor invisible while point off-screen (setq scroll-restore-cursor-type nil) ;; jump original cursor position after scrolling (setq scroll-restore-jump-back t) ;; toggle scroll-restore-mode scroll lock key (global-set-key (kbd "<scroll_lock>") 'scroll-restore-mode)
this direct copy of answer posted here: https://emacs.stackexchange.com/a/2273/93
Comments
Post a Comment