Torstein Johansen has an interesting post on his new Emacs configuration. He’s a long time Emacs user and his old configuration was 20 years old and 1617 lines long. After he refactored his configuration it was down to 368 lines. A lot of the refactoring was simply a matter of removing packages whose functionality had been superseded by core Emacs.
One thing he does in the video is to number each section of the configuration and then add (occur "^;; [0-9]+")
at the top. Executing that expression generates a table of contents for the file. That seems like a nice feature but it’s not in his final configuration, which may mean that there’s a problem when Emacs starts.
My own configuration is currently 2461 lines long so I’m sure it could also do with some refactoring. It’s a bit over 15 years old now so there’s bound to be some cruft in there. One comfort that I took away from Johansen’s video is that he keeps almost everything in a single file.
The current conventional practice is to separate discrete functionality into separate files. Johansen finds this hard to navigate and I agree. I get a lot of pushback whenever I say that but it’s still true. It’s nice to know that at least one other person agrees with me.
If you like seeing what other people are doing with their configuration, Johansen’s video is worth watching. The video is 27 minutes, 50 seconds long so you’ll need to schedule some time for it.