lassik / emacs-format-all-the-code

Auto-format source code in many languages with one command
https://melpa.org/#/format-all
MIT License
604 stars 105 forks source link

Save and restore the mark ring when reformatting #224

Closed jwiegley closed 1 year ago

jwiegley commented 1 year ago

Format-all has taught me that one of my common habits is to use C-u C-SPC after jumping to another part of the buffer and performing edits, in order to get back to where I was a moment ago. However, I also have a habit of saving the buffer, so once I save after making those edits, the mark ring is gone and I have manually find my way back to where I was before.

It should be fairly straightforward to save the mark ring as a set of marker-positions, then restore it after formatting.

I'll see if I can't get a PR up for this.