Skip to main content
ertius.org

a whole emacs minor mode

I was on a bit of a VSCode kick earlier this year, and one thing I quite liked was the Scoped Sort extension that would keep portions of a file lexigraphically sorted. I had a look and couldn't find a similar thing for emacs (which is unbelievable, I surely just can't search right), so I had a go at knocking it up myself. It's a single function to sort the lines (process: find start token, set mark, find end token, sort between point and mark) and an optional minor mode that hooks that function in to write-contents-functions.

Then I had a go at turning it into a package suitable for installation with (use-package), which was pretty easy (excellent docs, thanks!) and then sending in a pull request to MELPA. Who knows if they'll allow such a trivial package, but it was a fun morning nonetheless.

edit: the MELPA people very kindly gave me a bunch of tips on how to improve my elisp, and then I did, and then they accepted my silly little package in to the index; thanks!