Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I 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) 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.



Thanks. 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: