3 ms·
Related: My biggest complaint with Emacs is that when you scroll, the cursor moves to keep itself visible on-screen at all times. Modern text editors don't beha
by dreamcompiler 5y ago
Related: My biggest complaint with Emacs is that when you scroll, the cursor moves to keep itself visible on-screen at all times. Modern text editors don't behave this way--it's easy to scroll to a different location to look at something without losing your insertion point.
Has anybody written a patch for Emacs to implement this behavior?
- NoGravitas 5y agoI don't think so, and I think it might involve unreasonable changes to core. The "Emacs Way" here is to use a command that takes you back to where you were before. If you used tags navigation to get to what you wanted to look at, you could use `pop-tag-mark`, which is on M-, (other modes for getting around, like xref and LSP use the same binding). Or failing that, if you know you're staying in the same buffer, you can `set-mark-command`, scroll to where you want to look, and `exchange-point-and-mark` (and then deactivate the mark with C-g if you were in transient-mark-mode, which most people are these days). There's also a package `dogears' (https://github.com/alphapapa/dogears.el https://github.com/alphapapa/dogears.el) for saving your place to go back to automatically even if you're just scrolling. I recognize that all these solutions are not intuitive to someone who expects the cursor position to stay in the same place even if it scrolls offscreen.
- dreamcompiler 5y agoThanks. I was used to doing things 'the Emacs way' many years ago before GUI editors were common but now I go back and forth between Emacs and GUI editors a lot and Emacs seems like the odd duck. Guess I just need to relearn this stuff because the other features Emacs brings to the table (e.g. Magit) are too handy to do without.